Jackie-Jiang commented on code in PR #8667:
URL: https://github.com/apache/pinot/pull/8667#discussion_r869703942
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3381,19 +3384,40 @@ public void revertReplaceSegments(String
tableNameWithType, String segmentLineag
tableNameWithType, segmentLineageEntryId);
}
- private void updateSegmentLineageEntryToReverted(String tableNameWithType,
SegmentLineage segmentLineage,
- String segmentLineageEntryId, LineageEntry lineageEntry) {
+ private List<String> deleteOrUpdateSegmentLineageEntryToReverted(String
tableNameWithType,
+ SegmentLineage segmentLineage, String segmentLineageEntryId,
LineageEntry lineageEntry,
+ List<String> newSegments) {
// Check that all segments from 'segmentsFrom' are in ONLINE state in the
external view.
Set<String> onlineSegments =
getOnlineSegmentsFromExternalView(tableNameWithType);
Preconditions.checkArgument(onlineSegments.containsAll(lineageEntry.getSegmentsFrom()),
String.format(
Review Comment:
We should not have this check when reverting an `IN_PROGRESS` entry. It is
possible that the `segmentsFrom` are already expired and removed by the
retention manager
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3353,7 +3355,8 @@ public void revertReplaceSegments(String
tableNameWithType, String segmentLineag
}
// Update segment lineage entry to 'REVERTED'
- updateSegmentLineageEntryToReverted(tableNameWithType, segmentLineage,
segmentLineageEntryId, lineageEntry);
+ deleteOrUpdateSegmentLineageEntryToReverted(tableNameWithType,
segmentLineage, segmentLineageEntryId,
Review Comment:
Suggest keeping the `deleteOrUpdateSegmentLineageEntryToReverted` and
`updateSegmentLineageEntryToReverted` as 2 separate methods for clarity
--
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]