[FLUSS-1027] Stabilize KvSnapshotITCase snapshot triggering#3731
Draft
wolfkill wants to merge 1 commit into
Draft
[FLUSS-1027] Stabilize KvSnapshotITCase snapshot triggering#3731wolfkill wants to merge 1 commit into
wolfkill wants to merge 1 commit into
Conversation
2 tasks
Author
|
Additional local validation after opening the draft PR:
One sandboxed run of the full class failed before reaching test assertions because Curator could not bind a local ZooKeeper test port ( |
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 changed
This makes
KvSnapshotITCase.testKvSnapshotAndDeletetrigger KV snapshots deterministically instead of waiting for the periodic snapshot scheduler to eventually create snapshot IDs 0 and 1.The test now:
Root cause
putKv(...).get()only waits for the write request to finish. It does not guarantee that the KV pre-write buffer has already been flushed into the state visible to the snapshot path.KvTabletSnapshotTarget.initSnapshot()skips snapshot creation when the flushed KV log offset has not advanced beyond the previous snapshot offset. The previous test relied on a 1 second periodic snapshot interval and direct ZooKeeper polling, so the scheduler could fire before the KV data became snapshot-ready, leaving snapshot 0 absent and causing the flaky timeout reported in #1027.Validation
git diff --checkJAVA_HOME=/Users/cc/Library/Java/JavaVirtualMachines/corretto-18.0.2/Contents/Home mvn -pl fluss-server -am -Dtest=KvSnapshotITCase#testKvSnapshotAndDelete -DfailIfNoTests=false -DskipITs=false testBoth targeted runs passed with:
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0Closes #1027.