Skip to content

Commit

Permalink
removing redundant logs
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Bafna <[email protected]>
  • Loading branch information
gbbafna committed Mar 18, 2024
1 parent 9fe17bf commit 2a828e5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions server/src/main/java/org/opensearch/index/IndexService.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,9 @@ public synchronized IndexShard createShard(
Directory remoteDirectory = remoteDirectoryFactory.newDirectory(this.indexSettings, path);
remoteStore = new Store(shardId, this.indexSettings, remoteDirectory, lock, Store.OnClose.EMPTY, path);
} else {
logger.info("Hitting the migration case");
if (sourceNode != null && sourceNode.isRemoteStoreNode() == false) {
assert routing.primary();
logger.info("Hitting the migration case where we need to seed remote store");
logger.info("DocRep shard {} is migrating to remote", shardId);
seedRemote = true;
}
RemoteSegmentStoreDirectoryFactory directoryFactory = new RemoteSegmentStoreDirectoryFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4000,10 +4000,10 @@ public boolean isStartedPrimary() {
}

public boolean enableUploadToRemoteTranslog() {
return isStartedPrimary() || (shouldSeedRemoteStore() && hasOneSyncHappened());
return isStartedPrimary() || (shouldSeedRemoteStore() && hasOneRemoteSegmentSyncHappened());
}

private boolean hasOneSyncHappened() {
private boolean hasOneRemoteSegmentSyncHappened() {
assert indexSettings.isRemoteNode();
// We upload remote translog only after one remote segment upload in case of migration
RemoteSegmentStoreDirectory rd = getRemoteDirectory();
Expand Down Expand Up @@ -4814,7 +4814,6 @@ public ParsedDocument newNoopTombstoneDoc(String reason) {
* Rollback the current engine to the safe commit, then replay local translog up to the global checkpoint.
*/
void resetEngineToGlobalCheckpoint() throws IOException {
logger.info("Reseting to global checkpoint");
assert Thread.holdsLock(mutex) == false : "resetting engine under mutex";
assert getActiveOperationsCount() == OPERATIONS_BLOCKED : "resetting engine without blocking operations; active operations are ["
+ getActiveOperations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ private static BiFunction<IndexSettings, ShardRouting, TranslogFactory> getTrans
remoteStoreStatsTrackerFactory.getRemoteTranslogTransferTracker(shardRouting.shardId())
);
} else if (isRemoteStoreAttributePresent(settings) && shardRouting.primary()) {
logger.info("Hitting the migration case for translogs ");
return new RemoteBlobStoreInternalTranslogFactory(
repositoriesServiceSupplier,
threadPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ void finalizeRecovery(long targetLocalCheckpoint, long trimAboveSeqNo, ActionLis
|| (request.sourceNode().isRemoteStoreNode() && request.targetNode().isRemoteStoreNode())
? recoveryTarget::forceSegmentFileSync
: () -> {};
// ToDo : Do we need a new action to replay translog here ?

// TODO: make relocated async
// this acquires all IndexShard operation permits and will thus delay new recoveries until it is done
Expand Down

0 comments on commit 2a828e5

Please sign in to comment.