Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bhumika Saini <[email protected]>
  • Loading branch information
Bhumika Saini committed Apr 23, 2024
1 parent 5be4401 commit b1a2ada
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ public synchronized IndexShard createShard(
if (routing.primary() == false) {
throw new IllegalStateException("Can't migrate a remote shard to replica before primary " + routing.shardId());
}

logger.info("DocRep shard {} is migrating to remote", shardId);
seedRemote = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ private static void downloadOnce(TranslogTransferManager translogTransferManager
logger.debug("No translog files found on remote, checking local filesystem for cleanup");
if (FileSystemUtils.exists(location.resolve(CHECKPOINT_FILE_NAME))) {
final Checkpoint checkpoint = readCheckpoint(location);
if (isEmptyTranslog(checkpoint) == false && seedRemote == false) {
if (seedRemote) {
logger.debug("Remote migration ongoing. Retaining the translog on local, skipping clean-up");
} else if (isEmptyTranslog(checkpoint) == false) {
logger.debug("Translog files exist on local without any metadata in remote, cleaning up these files");
// Creating empty translog will cleanup the older un-referenced tranlog files, we don't have to explicitly delete
Translog.createEmptyTranslog(location, translogTransferManager.getShardId(), checkpoint);
} else if (isEmptyTranslog(checkpoint) == false && seedRemote) {
logger.debug("Remote migration ongoing. Retaining the translog on local, skipping clean-up");
} else {
logger.debug("Empty translog on local, skipping clean-up");
}
Expand Down

0 comments on commit b1a2ada

Please sign in to comment.