Skip to content

fix: DuplicatedKeyException not propagated as cause on Follower forwarded commands - #5014

Merged
robfrank merged 1 commit into
mainfrom
leonardo/issue-526-28777568908
Jul 6, 2026
Merged

fix: DuplicatedKeyException not propagated as cause on Follower forwarded commands#5014
robfrank merged 1 commit into
mainfrom
leonardo/issue-526-28777568908

Conversation

@arcadedb-support

Copy link
Copy Markdown
Contributor

Fix for a customer-reported issue: DuplicatedKeyException not propagated as cause on Follower forwarded commands.

I traced the root cause, reproduced it with a test, and verified the fix. Internal tracking: https://github.com/ArcadeData/arcadedb-operations/issues/526

Please review before merging.

@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codacy-production

codacy-production Bot commented Jul 6, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 88.89% diff coverage · -7.22% coverage variation

Metric Results
Coverage variation -7.22% coverage variation
Diff coverage 88.89% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (115dfa0) 134558 100099 74.39%
Head commit (54ee012) 166385 (+31827) 111765 (+11666) 67.17% (-7.22%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5014) 27 24 88.89%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.07407% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.40%. Comparing base (115dfa0) to head (54ee012).

Files with missing lines Patch % Lines
...rcadedb/server/ha/raft/RaftReplicatedDatabase.java 74.07% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5014      +/-   ##
============================================
- Coverage     65.40%   65.40%   -0.01%     
- Complexity      817      823       +6     
============================================
  Files          1685     1685              
  Lines        134558   134582      +24     
  Branches      28788    28797       +9     
============================================
+ Hits          88004    88017      +13     
- Misses        34496    34497       +1     
- Partials      12058    12068      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robfrank
robfrank merged commit 86a7562 into main Jul 6, 2026
27 of 32 checks passed
@robfrank
robfrank deleted the leonardo/issue-526-28777568908 branch July 6, 2026 09:47
lvca added a commit that referenced this pull request Jul 6, 2026
#5017)

Follow-up to #5014. When a Follower forwards a command to the Leader and the Leader returns an error, reconstructLeaderException now rebuilds the exact exception type instead of collapsing retryable subtypes onto their NeedRetryException supertype.

- ConcurrentModificationException / LockTimeoutException stay retryable NeedRetryException subtypes; non-retryable TimeoutException stays distinct.
- Command-path types (CommandExecution/CommandParsing/CommandSQLParsing/CommandSemantic/QueryNotIdempotent/Validation/Schema) are reconstructed faithfully via an explicit registry (no reflection).
- DuplicatedKeyException keeps its structured 3-arg reconstruction; unknown classes fall back to TransactionException.
- Tests pin the retryable vs non-retryable semantics (18 tests).

Follow-up issue #5018 tracks an unrelated latent dead branch spotted during review.
robfrank pushed a commit that referenced this pull request Aug 14, 2026
…rded commands (#5014)

Co-authored-by: Leonardo Page <l.page@arcadedata.com>
(cherry picked from commit 86a7562)
robfrank pushed a commit that referenced this pull request Aug 14, 2026
#5017)

Follow-up to #5014. When a Follower forwards a command to the Leader and the Leader returns an error, reconstructLeaderException now rebuilds the exact exception type instead of collapsing retryable subtypes onto their NeedRetryException supertype.

- ConcurrentModificationException / LockTimeoutException stay retryable NeedRetryException subtypes; non-retryable TimeoutException stays distinct.
- Command-path types (CommandExecution/CommandParsing/CommandSQLParsing/CommandSemantic/QueryNotIdempotent/Validation/Schema) are reconstructed faithfully via an explicit registry (no reflection).
- DuplicatedKeyException keeps its structured 3-arg reconstruction; unknown classes fall back to TransactionException.
- Tests pin the retryable vs non-retryable semantics (18 tests).

Follow-up issue #5018 tracks an unrelated latent dead branch spotted during review.

(cherry picked from commit ef0fdb3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant