You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2023/12/15 05:12:17 UTC
(pinot) branch master updated: refine warning msg when preloading segments not exist on server (#12153)
This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 46ae9e97ff refine warning msg when preloading segments not exist on server (#12153)
46ae9e97ff is described below
commit 46ae9e97ff45529928813f443f17d7269b5058c6
Author: Xiaobing <61...@users.noreply.github.com>
AuthorDate: Thu Dec 14 21:12:11 2023 -0800
refine warning msg when preloading segments not exist on server (#12153)
---
.../local/upsert/BaseTableUpsertMetadataManager.java | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BaseTableUpsertMetadataManager.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BaseTableUpsertMetadataManager.java
index e20b264c70..3e0894862c 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BaseTableUpsertMetadataManager.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BaseTableUpsertMetadataManager.java
@@ -233,9 +233,8 @@ public abstract class BaseTableUpsertMetadataManager implements TableUpsertMetad
ZKMetadataProvider.getSegmentZKMetadata(propertyStore, _tableNameWithType, segmentName);
Preconditions.checkState(zkMetadata != null, "Failed to find ZK metadata for segment: %s, table: %s", segmentName,
_tableNameWithType);
- File snapshotFile = getValidDocIdsSnapshotFile(segmentName, zkMetadata.getTier());
- if (!snapshotFile.exists()) {
- LOGGER.info("Skip segment: {} as no validDocIds snapshot at: {}", segmentName, snapshotFile);
+ if (!hasValidDocIdsSnapshot(segmentName, zkMetadata.getTier())) {
+ LOGGER.info("Skip segment: {} as no validDocIds snapshot exists", segmentName);
return;
}
preloadSegmentWithSnapshot(segmentName, indexLoadingConfig, zkMetadata);
@@ -255,9 +254,15 @@ public abstract class BaseTableUpsertMetadataManager implements TableUpsertMetad
_tableDataManager.tryLoadExistingSegment(segmentName, indexLoadingConfig, zkMetadata);
}
- private File getValidDocIdsSnapshotFile(String segmentName, String segmentTier) {
- File indexDir = _tableDataManager.getSegmentDataDir(segmentName, segmentTier, _context.getTableConfig());
- return new File(SegmentDirectoryPaths.findSegmentDirectory(indexDir), V1Constants.VALID_DOC_IDS_SNAPSHOT_FILE_NAME);
+ private boolean hasValidDocIdsSnapshot(String segmentName, String segmentTier) {
+ try {
+ File indexDir = _tableDataManager.getSegmentDataDir(segmentName, segmentTier, _context.getTableConfig());
+ File snapshotFile =
+ new File(SegmentDirectoryPaths.findSegmentDirectory(indexDir), V1Constants.VALID_DOC_IDS_SNAPSHOT_FILE_NAME);
+ return snapshotFile.exists();
+ } catch (Exception e) {
+ return false;
+ }
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org