FrankChen021 opened a new pull request, #20320:
URL: https://github.com/apache/druid/pull/20320

   Related to #20312 (item 7).
   
   ### Description
   
   `CompactionTaskTest.testCompactionWithTimestampDimension` failed on master 
with:
   
   ```
   Segment count mismatch in sys.segments table ==> expected: <2> but was: <>
     at 
EmbeddedClusterApis.verifyNumVisibleSegmentsIs(EmbeddedClusterApis.java:290)
     at CompactionTestBase.verifySegmentsCount(CompactionTestBase.java:102)
   ```
   
   Example: 
https://github.com/apache/druid/actions/runs/34443807042/job/102764139085.
   
   The Overlord-side assertion passed (2 visible used segments). 
`verifySegmentsCount` then waited for a single 
`segment/metadataCache/sync/time` event on the Broker and asserted the 
`sys.segments` count once. A sync that was already in flight when the 
compaction finished can complete while still reflecting the previous state, so 
one sync event does not guarantee the Broker has caught up.
   
   #### Changes
   
   * `EmbeddedClusterApis.verifyNumVisibleSegmentsIs` keeps the immediate 
Overlord assertion and polls the Broker-side `sys.segments` count using the 
existing `ResultWaiter` (60 s deadline). On timeout it throws an 
`AssertionError` that includes the expected count, the datasource and the last 
observed result.
   * `CompactionTestBase.verifySegmentsCount` no longer waits for the single 
sync event, since the poll covers it.
   
   `verifyNumVisibleSegmentsIs` has a single caller (`CompactionTestBase`).
   
   Verified locally with `mvn -pl services,embedded-tests -am test-compile`. 
The embedded compaction tests were not run locally.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `EmbeddedClusterApis`
    * `CompactionTestBase`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to