Repository navigation
fix(#9529): async batch replay waits the jittered retry backoff - #9535
Conversation
…e each attempt commitBatch() replayed a conflicted batch back to back, racing the workers that caused the conflict on the same bucket tail page; with four workers on one bucket about 1 run in 100 exhausted TX_RETRIES and lost a batch. The replay now sleeps the TX_RETRY_DELAY/TX_RETRY_DELAY_BASE exponential backoff with full jitter, like LocalDatabase.transaction().
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
ReviewSmall, focused fix that reuses Code
Tests
Overall this looks good to merge once the points above are checked. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ -5.64% coverage variation |
| Diff coverage | ✅ 87.50% diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (54721c4) 221022 189032 85.53% Head commit (dd8e9f4) 253654 (+32632) 202633 (+13601) 79.89% (-5.64%) 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 (#9535) 16 14 87.50% 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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughAsync batch commits now apply configured backoff before retrying a batch. Regression tests check delay behavior and record counts, including a four-worker insert test. ChangesAsync batch retry backoff
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Batch retries now apply the configured backoff, with no identified issue that needs resolution before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9535 +/- ##
=========================================
Coverage 77.30% 77.30%
+ Complexity 4131 4128 -3
=========================================
Files 2155 2155
Lines 221022 221037 +15
Branches 47290 47292 +2
=========================================
+ Hits 170850 170867 +17
+ Misses 32028 32026 -2
Partials 18144 18144 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #9529
commitBatch()replayed a batch that hit aConcurrentModificationExceptionback to back, so the replay raced the workers that caused the conflict on the same bucket tail page. With four workers on one bucket about 1 run in 100 (two cores) ran out ofarcadedb.txRetriesand reported a whole batch throughonError.The replay now sleeps the
TX_RETRY_DELAY/TX_RETRY_DELAY_BASEexponential backoff with full jitter (RetryBackoff, issue #5587) before every attempt after the first, the same policyLocalDatabase.transaction()uses.TX_RETRY_DELAY=0disables it.Tests:
Issue9529AsyncBatchReplayBackoffTest(hook-observed backoff window, no backoff without conflict, disabled at 0, 4-worker single-bucket load). The hook test fails without the fix. Related #7615/#7667 tests and the rest of the async engine tests pass (119 tests).Summary by CodeRabbit
Bug Fixes