noob-se7en commented on code in PR #18381:
URL: https://github.com/apache/pinot/pull/18381#discussion_r3261320296
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -606,6 +607,56 @@ protected void doOffloadSegment(String segmentName) {
}
}
+ @Override
+ public void deleteSegment(String segmentName)
+ throws Exception {
+ _logger.info("Deleting segment: {}", segmentName);
+ Lock segmentLock = getSegmentLock(segmentName);
+ segmentLock.lock();
Review Comment:
segment lock was already taken before, is it required here?
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -1014,9 +1090,17 @@ public void reloadSegment(String segmentName,
IndexLoadingConfig indexLoadingCon
indexLoadingConfig.setSegmentTier(segmentTier);
Review Comment:
doesnt this cause a race condn?
(I think if semaphore permits > 1, then race condn will exist before this PR
too)
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -1410,6 +1483,22 @@ protected void removeBackup(File indexDir)
@Override
public boolean tryLoadExistingSegment(SegmentZKMetadata zkMetadata,
IndexLoadingConfig indexLoadingConfig) {
+ ImmutableSegment segment = tryLoadExistingSegmentInternal(zkMetadata,
indexLoadingConfig);
+ if (segment == null) {
+ return false;
+ }
+ addSegment(segment, zkMetadata);
+ return true;
+ }
+
+ /**
+ * Just Loads a segment from the existing on-disk copy without registering
it in {@code _segmentDataManagerMap} or
+ * invoking other hooks.
+ * Returns {@code null} when the on-disk copy is absent, has a stale CRC
under or fails to load
+ */
+ @Nullable
+ public ImmutableSegment tryLoadExistingSegmentInternal(SegmentZKMetadata
zkMetadata,
Review Comment:
IMO the above name (tryLoadExistingSegmentWithoutRegistering) is relatively
better.
--
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]