Skip to content

HDDS-16453. Avoid flushing stateful service configuration during transaction apply - #11863

Open
F64116045 wants to merge 2 commits into
apache:masterfrom
F64116045:HDDS-16453
Open

F64116045 wants to merge 2 commits into
apache:masterfrom
F64116045:HDDS-16453

Conversation

@F64116045

@F64116045 F64116045 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

saveConfiguration() runs during Ratis transaction apply, before the transaction index is updated. Its direct flush() can persist data with the previous index, causing an already-persisted transaction to be replayed after a crash.

This PR uses flushIfNeeded(0) to defer the flush while apply is in progress. This keeps the data and transaction index consistent and avoids incorrect results from this replay if non-idempotent operations are introduced in the future.

This fixes a similar issue to #11837 in StatefulServiceStateManagerImpl.

What is the link to the Apache JIRA?

https://issues.apache.org/jira/browse/HDDS-16453

How was this patch tested?

Added a regression test that calls saveConfiguration() during apply and verifies that the configuration stays buffered until it can be flushed with the updated transaction index.

CI: https://github.com/F64116045/ozone/actions/runs/41179847269

@F64116045 F64116045 changed the title HDDS-16453. Avoid flushing stateful service configuration during tran… HDDS-16453. Avoid flushing stateful service configuration during transaction apply Oct 30, 2026
@github-actions github-actions Bot added the scm label Oct 30, 2026

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @F64116045 for working on this. Changes LGTM

@F64116045

Copy link
Copy Markdown
Contributor Author

hi @priyeshkaratha thanks for the review!

CI caught an issue with reading the saved configuration, so I moved the flush after the index update.

@F64116045
F64116045 marked this pull request as ready for review October 31, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants