tarun11Mavani commented on code in PR #19776:
URL: https://github.com/apache/pinot/pull/19776#discussion_r4215308653
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -77,6 +77,7 @@ public class SegmentDeletionManager {
// file will be permanently deleted after Feb 2nd 2022 12PM.
public static final String DELETED_SEGMENTS = "Deleted_Segments";
private static final String RETENTION_UNTIL_SEPARATOR =
"__RETENTION_UNTIL__";
+ private static final String DELETED_METADATA_FILE_SUFFIX = ".metadata";
private static final String RETENTION_DATE_FORMAT_STR = "yyyyMMddHHmm";
private static final SimpleDateFormat RETENTION_DATE_FORMAT;
Review Comment:
Good catch. The shared static `SimpleDateFormat` was already on master
(`getDeletedSegmentFileName`/ `getDeletionTimeMsFromFile`) and is touched by
the deletion executor, table deletion, and the RetentionManager sweep, so the
race was pre-existing rather than new here.
Replaced it with an immutable `DateTimeFormatter` (UTC). Same output for the
suffixes we write. Parsing is now strict, and a malformed suffix already falls
back to lastModified plus the default retention. `SegmentDeletionManagerTest`
passes.
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/SplitSegmentCommitter.java:
##########
@@ -100,4 +124,47 @@ protected String uploadSegment(File segmentTarFile,
SegmentUploader segmentUploa
}
return null;
}
+
+ // A peer:// location means the segment is NOT in deep store, so there is
nothing for a sidecar to describe.
+ // Mirrors the check in PinotLLCRealtimeSegmentManager.commitSegmentFile().
+ private static boolean isPeerSegmentLocation(String segmentLocation) {
+ return segmentLocation.regionMatches(true, 0,
CommonConstants.Segment.PEER_SEGMENT_DOWNLOAD_SCHEME, 0,
+ CommonConstants.Segment.PEER_SEGMENT_DOWNLOAD_SCHEME.length());
+ }
+
+ /// Best-effort: builds a tar containing one directory with
metadata.properties and creation.meta, and uploads it
+ /// under a tmp name next to the segment. Returns the tmp location for the
controller to move at commit end, or
+ /// null on any problem. Never fails or throws; a sidecar problem must not
affect the segment commit.
+ @Nullable
+ private String uploadMetadataTarQuietly(@Nullable Map<String, File>
metadataFiles, String segmentName) {
+ if (metadataFiles == null || metadataFiles.isEmpty()) {
+ return null;
+ }
+ LLCSegmentName llcSegmentName = new LLCSegmentName(segmentName);
Review Comment:
Done.
--
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]