objstore: wait for metadata workers after directory listing errors - #71139
ti-chi-bot[bot] merged 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthrough
ChangesUnmarshalDir error handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable merge risk is established for the worker synchronization or error propagation change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use 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. A rabbit saw workers race, Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #71139 +/- ##
================================================
- Coverage 76.3034% 73.9927% -2.3107%
================================================
Files 2041 2133 +92
Lines 555380 607096 +51716
================================================
+ Hits 423774 449207 +25433
- Misses 130706 154265 +23559
- Partials 900 3624 +2724
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/check-issue-triage-complete |
|
/retest |
| // An error is published before ch is closed. Both select cases may | ||
| // be ready, so do not mistake a listing/worker error for normal EOF. | ||
| select { | ||
| case err := <-errCh: | ||
| return iter.Throw[*T](err) | ||
| default: | ||
| return iter.Done[*T]() | ||
| } |
There was a problem hiding this comment.
Consider make error channel a blocking channel?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, YuJuncen The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #70807, close #67704
Problem Summary:
When object listing fails,
UnmarshalDircloses its result channel without waiting for already scheduled metadata workers. A worker that later sends a result can panic. Also, when the error channel and closed result channel are both ready, iteration can report normal completion instead of the listing error.What changed and how does it work?
Always join the worker group before closing the result channel, retaining the original listing error when both listing and workers fail. When observing a closed result channel, check for a pending error before returning normal completion.
The worker-lifetime regression blocks a metadata read, fails listing after the read starts, and checks that iteration cannot terminate until the worker completes. Before the fix it terminates prematurely; cleanup cancels the blocked read rather than deliberately crashing the test process with a send on the closed channel. A second repeated regression verifies that a completed failed listing cannot silently become EOF. Both regressions fail before the fix and pass afterward.
Check List
Tests
Ready validation:
Failpoints were disabled automatically after each run. Tests use a controlled storage implementation, not a live cloud account. Full-suite and end-to-end BR/PiTR tests were not run locally.
Related migration-version regression (#67704):
MigrationExt.Load passes migration decoding/version-validation errors through the same UnmarshalDir callback and returns the iterator error. Add coverage for a worker callback error after the producer has time to close the result channel. Temporarily restoring the old closed-channel branch makes this test fail with a nil error; restoring this PR's existing EOF handling makes it pass. No additional production change is needed.
The original TestUnsupportedVersion passed 200 runs both before and after the fix, so its original intermittent schedule was not directly reproduced. The callback-error regression provides the RED/GREEN evidence for the shared root cause.
Final tests and lint pass; failpoints are disabled and production code is identical to the prior PR head.
Side effects
After a listing error, iteration now waits for scheduled workers as required for safe shutdown, instead of reporting an error while they are still running. Successful-listing behavior and storage formats are unchanged. Remote-failure latency was not benchmarked.
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Bug Fixes
Tests