tarun11Mavani commented on PR #18733:
URL: https://github.com/apache/pinot/pull/18733#issuecomment-5114524814

   > I don't follow the scenario. When you encounter this issue, it means the 
existing record is out of TTL, and the new record is also out of TTL (it is 
even older than the existing record)?
   
   Not quite — TTL is only evaluated against the *existing stored* metadata, 
not the new record. There's no TTL check on the incoming record itself.
   
   Concretely (this is the scenario the new test covers):
   - PK=0 is stored with comparisonValue=1000.
   - PK=1 arrives with comparisonValue=1200, which becomes the new watermark 
(`_largestSeenComparisonValue`).
   - With `metadataTTL=100`, the threshold is `1200-100=1100`. PK=0's stored 
value (1000) is now below that threshold, so its metadata is expired — even 
though 1000 isn't "old" in any absolute sense, just relative to the current 
watermark.
   - Now a new record for PK=0 arrives with comparisonValue=900 — lower than 
the stored 1000. Today this gets rejected as out-of-order (900 < 1000). With 
the fix, since the *existing* entry is already expired, we skip the comparison 
entirely and accept the new record unconditionally, treating it as if PK=0 had 
never been seen.
   
   So the new record doesn't need to be "out of TTL" — it just needs to arrive 
after the existing entry has fallen behind the watermark by more than 
`metadataTTL`. For partial-upsert tables this also matters for merging: if the 
previous entry is expired, we skip merging the new record's unset fields 
against that stale previous row, since that data is considered gone.
   


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