GeezerVison is showing github.com — Propagate IO errors to the writer on log segment close by keynslug · Pull Request #587 · rabbitmq/ra
Conversation
keynslug
commented
Mar 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Proposed Changes
This PR is a followup to a discussion in #578.
IO errors during log segment close are now propagated to the segment writer, causing whole WAL flush operation to fail.
This change essentially makes IO error handling consistent: before this PR, such errors were properly propagated during flush-on-append [1] but not during flush-on-close [2] [3]. This could have subsequently caused affected log segments to have holes in the index sequence, which is demonstrated in segment_close_flush_error_recovery testcase.
I did my best to make it reviewable commit-by-commit.
Types of Changes
- Bug fix (non-breaking change which fixes issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- Documentation (correction or otherwise)
- Cosmetics (whitespace, appearance)
Checklist
- I have read the
CONTRIBUTING.md document
- I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
- All tests pass locally with my changes
- I have added tests that prove my fix is effective or that my feature works
-
I have added necessary documentation (if appropriate)
-
Any dependent changes have been merged and published in related repositories
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@keynslug thank you for your contributions.
Please make sure to sign our CLA (it takes sending one email and signing one document using Box Sign).
|
keynslug reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I think it would be reasonable to update ra_log_sement:close/1 to simply return any errors encountered during sync or close (ignore file:advise errors) and instead update the call sites to ignore or fail as appropriate.
|
keynslug reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This commit makes sure that failure to flush WAL into log segment
is not ignored in situations where flush happens during segment
close.
|
@keynslug any updates on the CLA signing front?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@keynslug any updates on the CLA signing front?
Yes. Did it on Mar 06. Attributed to my primary email address, the same as in the commits. Do you need any extra information regarding this, e.g. "Document ID"?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@keynslug nope, just wanted to confirm. I did find the signed document. Sorry for the noise.
|
keynslug reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Gentle ping / heads up, @kjnilsson: I made an attempt to implement your suggestion (as I understood it) in 80961e0.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Gentle ping / heads up, @kjnilsson: I made an attempt to implement your suggestion (as I understood it) in 80961e0.
I still feel there are a lot of changes just to return errors from ra_log_segment:close/1, you should only really need to modify that one function and perhaps a couple of call sites.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Gentle ping / heads up, @kjnilsson: I made an attempt to implement your suggestion (as I understood it) in 80961e0.
I still feel there are a lot of changes just to return errors from ra_log_segment:close/1, you should only really need to modify that one function and perhaps a couple of call sites.
something like #592 - @keynslug can you see if this PR also solves your issue?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closed as we've merged: #592
@keynslug if there is anythging this PR addresses that we've missed let us know. Cheers.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @kjnilsson, I believe #592 addresses the underlying issue, according to unit test runs and a brief review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|