Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
sachinpkale committed Sep 24, 2024
1 parent c6fcae8 commit f649a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void trimUnreferencedReaders(boolean indexDeleted, boolean trimLocal)

// This is to ensure that after the permits are acquired during primary relocation, there are no further modification on remote
// store.
if ((indexDeleted == false && startedPrimarySupplier.getAsBoolean() == false) || pauseSync.get()) {
if (indexDeleted == false && (startedPrimarySupplier.getAsBoolean() == false || pauseSync.get())) {
return;
}

Expand Down Expand Up @@ -505,7 +505,7 @@ protected static Tuple<Long, Long> getMinMaxPrimaryTermFromMetadataFile(
}
}

public static void cleanup(TranslogTransferManager translogTransferManager, boolean forceClean) throws IOException {
public static void cleanupOfDeletedIndex(TranslogTransferManager translogTransferManager, boolean forceClean) throws IOException {
if (forceClean) {
translogTransferManager.delete();
} else {
Expand All @@ -523,7 +523,7 @@ public void onResponse(List<BlobMetadata> blobMetadata) {
metadataFiles,
new HashMap<>(),
Long.MAX_VALUE,
true,
true, // This method gets called when the index is no longer present
staticLogger
);
if (metadataFilesToBeDeleted.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ private void remoteTranslogCleanupAsync(
indexMetadataEnabled
);
try {
RemoteFsTimestampAwareTranslog.cleanup(translogTransferManager, forceClean);
RemoteFsTimestampAwareTranslog.cleanupOfDeletedIndex(translogTransferManager, forceClean);
} catch (IOException e) {
logger.error("Exception while cleaning up remote translog for shard: " + shardId, e);
}
Expand Down

0 comments on commit f649a25

Please sign in to comment.