GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Propagate IO errors to the writer on log segment close by keynslug · Pull Request #587 · rabbitmq/ra

Conversation

@keynslug

@keynslug keynslug commented Mar 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@keynslug
Add testcase for IO error on log segment close
f57ec77
@michaelklishin

michaelklishin commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kjnilsson

kjnilsson commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@keynslug
Propagate IO errors to the writer on log segment close
80961e0
This commit makes sure that failure to flush WAL into log segment
is not ignored in situations where flush happens during segment
close.
@keynslug
keynslug force-pushed the fix/main/silent-flush-error branch from 53d185a to 80961e0 Compare March 9, 2026 10:34
@michaelklishin

michaelklishin commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

@keynslug any updates on the CLA signing front?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@keynslug

keynslug commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

@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"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michaelklishin

michaelklishin commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

@keynslug nope, just wanted to confirm. I did find the signed document. Sorry for the noise.

keynslug reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@keynslug

keynslug commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

Gentle ping / heads up, @kjnilsson: I made an attempt to implement your suggestion (as I understood it) in 80961e0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kjnilsson

kjnilsson commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kjnilsson

kjnilsson commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kjnilsson

kjnilsson commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Closed as we've merged: #592

@keynslug if there is anythging this PR addresses that we've missed let us know. Cheers.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kjnilsson kjnilsson closed this Mar 17, 2026
@keynslug

keynslug commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @kjnilsson, I believe #592 addresses the underlying issue, according to unit test runs and a brief review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@keynslug keynslug mentioned this pull request Nov 13, 2026
v2.17.x-emqx: port API changes / backport upstream fixes emqx/ra#4
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@keynslug @michaelklishin @kjnilsson
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.