deepthi912 commented on code in PR #19028:
URL: https://github.com/apache/pinot/pull/19028#discussion_r3626754920
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -577,15 +592,22 @@ public void replaceSegment(ImmutableSegment segment,
IndexSegment oldSegment) {
}
try {
doReplaceSegment(segment, oldSegment);
- if (!(segment instanceof EmptyIndexSegment)) {
+ if (segment instanceof ImmutableSegmentImpl) {
+ ImmutableSegmentImpl immutableSegment = (ImmutableSegmentImpl) segment;
_trackedSegments.add(segment);
if (_enableSnapshot) {
- _updatedSegmentsSinceLastSnapshot.add(segment);
+ _updatedSegmentsSinceLastSnapshot.add(immutableSegment);
+ // Evaluate the snapshot file on the new segment object because the
replacement might have kept it
+ // (e.g. segment reload) or started from a clean segment directory
(e.g. segment re-download).
+ if (hasValidDocIdsSnapshotFile(immutableSegment)) {
+ _segmentsWithSnapshot.add(immutableSegment);
+ }
}
}
_trackedSegments.remove(oldSegment);
Review Comment:
These three lines into a single method:
_trackedSegments.remove(oldSegment);
_updatedSegmentsSinceLastSnapshot.remove(oldSegment);
_segmentsWithSnapshot.remove(oldSegment);
--
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]