spapin opened a new pull request, #18859:
URL: https://github.com/apache/pinot/pull/18859

   ## Problem
   `SegmentLineage.toJsonObject()` sorted entries by **millisecond** timestamp 
only, over a `HashMap`. Entries sharing a millisecond fell back to arbitrary 
UUID-hash iteration order, so the list API output was non-deterministic. 
`testListSegmentLineage` asserts two back-to-back `startReplaceSegments` 
entries appear in a fixed order; on a fast machine the two share a millisecond 
~57% of the time, and the assertion failed ~29% of runs (measured over 1000 
runs).
   
   ## Fix
   Add the entry id as a sort tiebreaker: entries are ordered by `(timestamp, 
then id)`. This makes the list output **deterministic** for a given set of 
entries. Entries remain identified by UUID. The code generally doesn't make any 
use of the ordering, but segmentLineage prints a summary where segments at the 
same millisecond may appear out of order.
   
   The test derives the expected order with the same `(timestamp, id)` sort and 
asserts the response lists the two entries in that order — deterministic 
regardless of whether the timestamps tie.


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