Jackie-Jiang opened a new pull request, #19319:
URL: https://github.com/apache/pinot/pull/19319

   ## Summary
   
   Fixes a flake in 
`UpsertTableSegmentPreloadIntegrationTest.testSegmentAssignment` where 
`waitForSnapshotCreation` timed out after 600s with `Failed to verify 
snapshots` (e.g. [this 
run](https://github.com/apache/pinot/actions/runs/32252324986) on an unrelated 
dependency bump).
   
   The test required a validDocIds snapshot under every immutable segment 
directory, but snapshots for the just committed segments are only best effort:
   - Upsert snapshots are taken once per partition when the new consuming 
segment starts consuming (triggered here by resuming consumption). 
`doTakeSnapshot` acquires each segment's `segmentLock` with `tryLock` and skips 
the segment on contention, and a skipped segment is not retried until the next 
snapshot round — which never comes in this test because no more data is 
consumed after the resume.
   - The just committed segment's lock is exactly the contended one: the 
committing thread holds it across build + commit + replace, and the CONSUMING 
-> ONLINE state transition (dispatched by the controller mid-commit) queues on 
the same lock and holds it across ZK reads right after. The query-based wait 
before resuming only observes `registerSegment`, which happens before both 
holders release the lock, so the snapshot round's single `tryLock` can land 
while the lock is still held.
   
   The uploaded segments have no lock contenders at that point (and the skip 
cascade cannot trigger since no segment has a prior snapshot on disk), so their 
snapshots are guaranteed. Update the check to verify snapshots only for the 
uploaded segments, excluding LLC segment dirs — which in this 
single-commit-cycle test are exactly the just committed ones — and assert the 
expected dir count so the check cannot pass vacuously. The restart that follows 
still exercises preload either way, since preload handles segments with or 
without snapshots.
   


-- 
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