Hi team, We ran into an issue while copying data ...
# troubleshooting
b
Hi team, We ran into an issue while copying 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. This causes failures when we later try to migrate or upload those segments from deep store into a newly created Realtime table (e.g., in another Pinot cluster). Because
ZKOperator
sees them as new LLC segments, the upload fails with:
Copy code
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
Question: Is there any way we can disable this check ..? Root Issue and possible fix : In the Minion task executors (e.g., inside
UpsertCompactionTaskExecutor#getSegmentGeneratorConfig
),
SegmentGeneratorConfig
is created from the input
SegmentMetadataImpl
without copying over
startOffset
and
endOffset
. As a result,
SegmentIndexCreationDriverImpl
will use them when writing
metadata.properties
. If we propagate these values when present on the source `SegmentMetadataImpl`:
Copy code
if (segmentMetadata.getStartOffset() != null) {
  config.setStartOffset(segmentMetadata.getStartOffset());
}
if (segmentMetadata.getEndOffset() != null) {
  config.setEndOffset(segmentMetadata.getEndOffset());
}
the rebuilt segments will retain their original stream offsets in
metadata.properties
and remain portable across clusters. @Xiang Fu , @Mayank
x
I believe you can upload the segment with a different segment name which may help you bypass this issue
b
We have cluster a → table 1 cluster b → table 1 Now we are attempting to copy the segment from cluster a to b , for this we cannot change the sgement name , or even changing that, wont fix this ( i believe ) as we are uploading this to realtime table again, both the tables are LLC , which will do offset validation before uploading
metadata.properties that associated with the segments does not contain the offset info anymore, due to the minion task
Please clarify if im wrong on this ..
Now one more thing is that, the zookeeper
PROPERTYSTORE/SEGMENT
znode still contain offset info for each segments, its only missing from the
deepstore
tar segments , so a work around that we done is , adding this missing offset by getting
segmentMetadata
from zonde ( using controller api ) and updating the
metadata.proeprties
before attempting to push
x
I see, then the way is to update metadata properties file and re-pack the segment
b
True … and which we are currently doing as mentioned in above workaround , So, can we add this additional steps in the minion jobs, to add offset back if the segments are belongs to LLC tables or if the segment metadata contains these offset values , do you see any issue/challenge with this change .. ?
m
A simple work-around could be to create hybrid table in cluster-b, and move the existing segments into the offline table.
👍 1
But if that is not an option, then yes, what @Xiang Fu mentioned.
b
Thank you for the work-around suggestion . Just confirming again, adding these property back to segment make sense, since this will also syc the metadata in zookeeper and
metadata.proeprty
associated with segment in deep store , If possible can we include this change , this will also ensure smooth data copy from realtime to realtime ( if hybrid mode is not possible ) , this will be also true incase if the realtime tables are upsert enabled
and also like you said, even after adding this property , will keep allow you to upload the segment to OFFLINE table ( hybrid mode ) if we want ..
@Xiang Fu any update on this .
x
I feel we may want to skip the check for start/end offset for realtime segment uploading
👍 1
b
That would be great …
Copy code
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");
        }