Repository navigation
fix: complete normal segment rollover asynchronously - #439
Conversation
CI commandsComment any of these to rerun checks on this pull request:
The |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #439 +/- ##
==========================================
+ Coverage 84.08% 84.17% +0.09%
==========================================
Files 221 221
Lines 31311 31300 -11
==========================================
+ Hits 26329 26348 +19
+ Misses 3737 3715 -22
+ Partials 1245 1237 -8
🚀 New features to boost your workflow:
|
|
/rerun-unit-test |
|
Rerunning unit-test workflow. Check the Actions tab for progress. |
Adversarial review found no issues requiring changes. The empty-queue rollover now uses the same async completion path as the non-empty drain path, and the two remaining findings are cleanup items that don't affect runtime behavior. Verified:
Low / nitpick (non-blocking)Low
Nitpick
|
|
/rerun-all |
|
/rerun |
|
Rerunning 1 failed workflow(s). Check the Actions tab for progress. |
Normal segment rollover waits for completion when the old segment's pending append queue is empty. With embedded MinIO and
conditionWrite: disable, fencing sees the live writer's ownwrite.lockand waits 30 seconds, blocking creation of the next segment and foreground writes.Make the empty-queue path trigger the same background completion lifecycle used after pending appends drain, then return immediately. Existing background failure/takeover notifications, completion metadata guarantees, and explicit close/recovery waits remain in place.
Closes #438.
Related: #437 (normal-rollover report), #434 (recovery timeout involving the same fallback wait), and Milvus discussion #49417 (fallback-mode recovery context).
Regression coverage
Validation
go test -race ./woodpecker/segment ./woodpecker/log -count=1 -timeout=4m— passed.-cover -count=1: all six subtests and the result guard passed (~217s).golangci-lint run --config .golangci.yml --timeout=10m— passed (0 issues).actionlintfor all changed workflows andgit diff --check— passed.Local disabled-mode rollover appends improved from 30.27–30.31s to approximately 0.214s. In the 20-roll/42-write CI-command run, ordinary-write p95 was 214ms, rollover-write p95 239ms, and all 42 entries were read back successfully.
Scope
This optimizes foreground writes during normal rollover. The fallback fencing grace period remains: cross-segment reads still exhibited approximately 28–29s waits, and explicit writer close approximately 30s. This PR does not claim to fully resolve the tSafe/strong-consistency failures in #437.