Conversation
…fterExpiry The assertions read the OM tables through an RDB iterator, which bypasses the table cache, while OM acknowledges a write as soon as the double buffer queues the response. A key created by the immediately preceding call can therefore still be invisible when the assertion runs.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues; the changes address the flaky assertions while preserving their strictness.
Review effort: Lite
Findings: None
What changed in this PR
This pull request fixes flaky TestHSync assertions by waiting for OM double-buffer persistence before reading open-file tables.
Changes:
- Added flush waits in both affected tests.
- Preserved strict table-content assertions.
| File | Description |
|---|---|
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java |
Synchronizes assertions with OM persistence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
TestHSync#testHSyncOpenKeyCommitAfterExpiryintermittently sees onlyhsync-keyin the open file table, even though it expects bothhsync-keyandkey2.The assertions read the OM tables through an RDB iterator, which bypasses the table cache. At the same time, OM acknowledges a write as soon as it is queued in the double buffer. As a result, the
fs.create(key2)immediately preceding the assertion may not have been persisted yet, whilehsync-keyalready has, because it went through an additional hsync round trip.testHSyncOpenKeyCommitAfterExpiry.testHSyncOpenKeyDeletionWhileDeleteDirectory, whose assertion afteros.hsync()has the same race.This file already waits for the double buffer before seven other table reads, so these changes preserve the strength of the assertions rather than weakening them.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16523
How was this patch tested?
Both test methods pass locally, with checkstyle and PMD clean for the module.
The race was also made deterministic to confirm the fix addresses it: pausing the double buffer before
fs.create(key2)and unpausing it from another thread three seconds later. Without this patch the assertion then fails exactly as reported in the JIRA.The same stalled run passes with the patch. That instrumentation is not part of the change.
Generated-by: Claude Code (Opus 5)