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

   Upsert compaction, segment refresh and purge rebuild a segment under the 
same name, but the rebuilt segment lost `segment.start.offset` and 
`segment.end.offset` from its `metadata.properties`. Nothing in the source 
cluster notices, because the controller keeps the offsets already in the 
segment ZK metadata when the uploaded segment has none. The deep store copy is 
left without them though, so uploading that LLC segment as a new segment, for 
example to a real-time table in another cluster, fails with `New uploaded LLC 
segment must have start/end offset in the segment metadata`.
   
   This carries the offsets over to the rebuilt segment in all three tasks. 
They come from the original segment, and fall back to the segment ZK metadata 
when the segment has none, so segments that already lost their offsets get them 
back on their next rewrite.
   
   A few details for review:
   
   - The ZK fallback only applies to real-time tables. Compaction and refresh 
read the segment ZK metadata only when the segment has no offsets. Purge reads 
it once per task, because the executor does not parse the segment metadata 
itself.
   - Both offsets are required. A segment or ZK record with only one of them is 
treated as having none.
   - `SegmentPurger` gets a constructor overload for the fallback offsets and 
keeps the existing one. A purged segment that is given a different name does 
not inherit the offsets.
   - A rewritten segment now carries offsets, so the controller writes them 
back to the segment ZK metadata on re-upload. In normal operation they are the 
values already there.
   
   The tests run each task's real rebuild path and cover offsets kept from the 
segment, segment offsets preferred over ZK, the ZK fallback, incomplete ZK 
offsets and no offsets at all.
   


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