Stabilize testReload in PartialUpsertTableRebalanceIntegrationTest - #19125
Open
deepthi912 wants to merge 1 commit into
Open
Stabilize testReload in PartialUpsertTableRebalanceIntegrationTest#19125deepthi912 wants to merge 1 commit into
deepthi912 wants to merge 1 commit into
Conversation
waitForReloadToComplete only tracks per-segment reload completion, not IdealState settlement. For partial-upsert reload the CONSUMING segment is force-committed and a new CONSUMING segment is created; the reload job can report done while IdealState still holds a transient OFFLINE or ExternalView still lags. Add waitForClusterStateSettled that requires expected segment count, no OFFLINE anywhere, and ExternalView == IdealState, sustained across 5 samples (~1s). Also add descriptive failure messages to verifySegmentAssignment so a real stall surfaces the segment name, instance, and full assignment map instead of a bare "expected [ONLINE] but found [OFFLINE]".
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #19125 +/- ##
=============================================
- Coverage 65.56% 37.89% -27.67%
- Complexity 1417 1422 +5
=============================================
Files 3432 3432
Lines 218110 218110
Branches 34661 34661
=============================================
- Hits 143009 82661 -60348
- Misses 63533 127852 +64319
+ Partials 11568 7597 -3971
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
PartialUpsertTableRebalanceIntegrationTest#testReload(and its downstream RocksDB subclass) can flake withexpected [ONLINE] but found [OFFLINE]atverifySegmentAssignmentline 304. The failure is a state-check-too-early issue in the test, not a product bug.Why
waitForReloadToCompletepolls the reload job status API, which only records per-segment reload completion. For a partial-upsert reload inPROTECTEDconsistency mode, the CONSUMING segment is force-committed, the controller atomically flips it CONSUMING → ONLINE and creates a new CONSUMING segment. But:totalSegmentCountis a snapshot at job start — it doesn't include the new CONSUMING segments created by force-commit.waitForAllDocsLoadeduses brokerSELECT COUNT(*)which routes via ExternalView; it cannot detect that an IdealState replica flipped OFFLINE while another still serves.postStopConsumedMsg,PinotLLCRealtimeSegmentManager.segmentStoppedConsumingmarks the segment OFFLINE in IdealState;RealtimeSegmentValidationManagerthen creates a repair segment. IdealState now has an older segment withseq < maxSeqin OFFLINE state — which is exactly what the assertion sees.None of the existing waits look at IdealState directly.
Changes (test-only, no product code)
File:
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/PartialUpsertTableRebalanceIntegrationTest.javawaitForClusterStateSettled(table, expectedSegments, stableSamples, timeoutMs)that requires all of:expectedSegmentsentries.ExternalView.mapFields.equals(IdealState.mapFields).stableSamplesconsecutive polls (5 samples at 200ms → ~1s of stability).testReloadcalls it betweenwaitForAllDocsLoadedandverifyIdealState.verifySegmentAssignmentassertions now include segment name, instance,maxSequenceNumber, and the full assignment map. If a real server-side stall causes OFFLINE (not a race), the CI log will surface which segment on which instance — not a bareexpected [ONLINE] but found [OFFLINE].Test plan
./mvnw spotless:apply checkstyle:check -pl pinot-integration-tests— clean./mvnw -pl pinot-integration-tests -am test -Dtest=PartialUpsertTableRebalanceIntegrationTest#testReload— passes (23s)