Jackie-Jiang commented on code in PR #10216: URL: https://github.com/apache/pinot/pull/10216#discussion_r1095085905
########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/SegmentCommitterFactory.java: ########## @@ -69,9 +70,13 @@ public SegmentCommitter createSegmentCommitter(boolean isSplitCommit, SegmentCom boolean uploadToFs = _streamConfig.isServerUploadToDeepStore(); String peerSegmentDownloadScheme = _tableConfig.getValidationConfig().getPeerSegmentDownloadScheme(); - // TODO: exists for backwards compatibility. remove peerDownloadScheme non-null check once users have migrated - if (uploadToFs || peerSegmentDownloadScheme != null) { - segmentUploader = new PinotFSSegmentUploader(_indexLoadingConfig.getSegmentStoreURI(), + String segmentStoreUri = _indexLoadingConfig.getSegmentStoreURI(); + + // We seem to allow the server instance to come up without a valid segment store uri. Hence, this check is needed. + if (!Strings.isNullOrEmpty(segmentStoreUri) Review Comment: (minor) We usually use `StringUtils.isEmpty()` (from `org.apache.commons.lang3`) ########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/SegmentCommitterFactory.java: ########## @@ -69,9 +70,13 @@ public SegmentCommitter createSegmentCommitter(boolean isSplitCommit, SegmentCom boolean uploadToFs = _streamConfig.isServerUploadToDeepStore(); String peerSegmentDownloadScheme = _tableConfig.getValidationConfig().getPeerSegmentDownloadScheme(); - // TODO: exists for backwards compatibility. remove peerDownloadScheme non-null check once users have migrated - if (uploadToFs || peerSegmentDownloadScheme != null) { - segmentUploader = new PinotFSSegmentUploader(_indexLoadingConfig.getSegmentStoreURI(), + String segmentStoreUri = _indexLoadingConfig.getSegmentStoreURI(); + + // We seem to allow the server instance to come up without a valid segment store uri. Hence, this check is needed. + if (!Strings.isNullOrEmpty(segmentStoreUri) Review Comment: (MAJOR) When segment upload fails, but peer download is enabled, we still want to use the `PinotFSSegmentUploader` because peer download doesn't require segment to be successfully uploaded. We can attach this check to the `uploadToFs` ########## pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java: ########## @@ -111,6 +112,10 @@ public synchronized void init(PinotConfiguration config, HelixManager helixManag _instanceId = _instanceDataManagerConfig.getInstanceId(); _helixManager = helixManager; _serverMetrics = serverMetrics; + if (Strings.isNullOrEmpty(_instanceDataManagerConfig.getSegmentStoreUri())) { Review Comment: (minor) We usually use `StringUtils.isEmpty()` -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org