Badhsuha opened a new issue, #20396:
URL: https://github.com/apache/pinot/issues/20396

   We ran into an issue while migrating data from one Pinot cluster to another 
and running a metadata push on Realtime (LLC) segments that had previously been 
processed by Minion tasks (such as `UpsertCompactionTask` or other segment 
conversion tasks).
   
   The Issue
   
   Normally, committed Realtime (LLC) segments store segment.start.offset and 
segment.end.offset in their `metadata.properties`. However, when a Minion task 
processes and rebuilds these segments, those offset properties are dropped from 
the generated metadata.properties before the segment is uploaded back to the 
controller.
   
   On the source cluster, this goes unnoticed because the segment's ZooKeeper 
metadata already exists and preserves the original offsets during segment 
replacement. However, when we later copy those segments from deep store and run 
a metadata push into a newly created Realtime table (e.g., on a DR or secondary 
Pinot cluster), ZKOperator sees them as brand-new LLC segments and fails the 
upload with:
   
   Got invalid segment metadata when adding segment: <segmentName> for table: 
<tableName>, reason: New uploaded LLC segment must have start/end offset in the 
segment metadata
   
   
   Root Cause
   
   In ZKOperator (when handling new LLC segment uploads), Pinot strictly 
enforces that startOffset and endOffset must be present in the incoming 
SegmentMetadata:
   
   ```
   if (newSegment && LLCSegmentName.isLLCSegment(segmentMetadata.getName())) {
     Preconditions.checkArgument(
         segmentMetadata.getStartOffset() != null && 
segmentMetadata.getEndOffset() != null,
         "New uploaded LLC segment must have start/end offset in the segment 
metadata");
   }
   ```
   
   
   Because Minion-rebuilt segments in deep store no longer carry these 
properties in `metadata.properties`, any cross-cluster segment upload or 
metadata push for compacted/converted LLC segments fails.
   
   Proposed Fix / Question
   
   Instead of requiring every Minion task executor to preserve offsets (which 
also doesn't help already-compacted segments sitting in deep store), can we 
remove this strict precondition check (or make it configurable/bypassable 
during segment upload/metadata push)?
   
   Specifically, removing or relaxing:
   
   ```
   if (newSegment && LLCSegmentName.isLLCSegment(segmentMetadata.getName())) {
     Preconditions.checkArgument(
         segmentMetadata.getStartOffset() != null && 
segmentMetadata.getEndOffset() != null,
         "New uploaded LLC segment must have start/end offset in the segment 
metadata");
   }
   ```


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