Skip to content

Commit

Permalink
Change noisy logs on SegRep and remote store paths to trace level (op…
Browse files Browse the repository at this point in the history
…ensearch-project#9323)

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
  • Loading branch information
mch2 authored and shiv0408 committed Apr 25, 2024
1 parent d7338a8 commit 14a8a99
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions server/src/main/java/org/opensearch/index/shard/IndexShard.java
Original file line number Diff line number Diff line change
Expand Up @@ -1641,20 +1641,20 @@ public Tuple<GatedCloseable<SegmentInfos>, ReplicationCheckpoint> getLatestSegme
*/
public boolean isSegmentReplicationAllowed() {
if (indexSettings.isSegRepEnabled() == false) {
logger.warn("Attempting to perform segment replication when it is not enabled on the index");
logger.trace("Attempting to perform segment replication when it is not enabled on the index");
return false;
}
if (getReplicationTracker().isPrimaryMode()) {
logger.warn("Shard is in primary mode and cannot perform segment replication as a replica.");
logger.trace("Shard is in primary mode and cannot perform segment replication as a replica.");
return false;
}
if (this.routingEntry().primary()) {
logger.warn("Shard routing is marked primary thus cannot perform segment replication as replica");
logger.trace("Shard routing is marked primary thus cannot perform segment replication as replica");
return false;
}
if (state().equals(IndexShardState.STARTED) == false
&& (state() == IndexShardState.POST_RECOVERY && shardRouting.state() == ShardRoutingState.INITIALIZING) == false) {
logger.warn(
logger.trace(
() -> new ParameterizedMessage(
"Shard is not started or recovering {} {} and cannot perform segment replication as a replica",
state(),
Expand All @@ -1664,7 +1664,7 @@ public boolean isSegmentReplicationAllowed() {
return false;
}
if (getReplicationEngine().isEmpty()) {
logger.warn(
logger.trace(
() -> new ParameterizedMessage(
"Shard does not have the correct engine type to perform segment replication {}.",
getEngine().getClass()
Expand Down Expand Up @@ -4815,8 +4815,8 @@ private String copySegmentFiles(
}
}
} finally {
logger.info("Downloaded segments here: {}", downloadedSegments);
logger.info("Skipped download for segments here: {}", skippedSegments);
logger.trace("Downloaded segments here: {}", downloadedSegments);
logger.trace("Skipped download for segments here: {}", skippedSegments);
}
return segmentNFile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private boolean shouldSync(boolean didRefresh) {

private boolean syncSegments() {
if (indexShard.getReplicationTracker().isPrimaryMode() == false || indexShard.state() == IndexShardState.CLOSED) {
logger.info(
logger.trace(
"Skipped syncing segments with primaryMode={} indexShardState={}",
indexShard.getReplicationTracker().isPrimaryMode(),
indexShard.state()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public RemoteSegmentMetadata readLatestMetadataFile() throws IOException {
logger.trace("Reading latest Metadata file {}", latestMetadataFile);
remoteSegmentMetadata = readMetadataFile(latestMetadataFile);
} else {
logger.info("No metadata file found, this can happen for new index with no data uploaded to remote segment store");
logger.trace("No metadata file found, this can happen for new index with no data uploaded to remote segment store");
}

return remoteSegmentMetadata;
Expand Down Expand Up @@ -786,7 +786,7 @@ public void deleteStaleSegments(int lastNMetadataFilesToKeep) throws IOException
Integer.MAX_VALUE
);
if (sortedMetadataFileList.size() <= lastNMetadataFilesToKeep) {
logger.info(
logger.trace(
"Number of commits in remote segment store={}, lastNMetadataFilesToKeep={}",
sortedMetadataFileList.size(),
lastNMetadataFilesToKeep
Expand Down Expand Up @@ -849,7 +849,7 @@ public void deleteStaleSegments(int lastNMetadataFilesToKeep) throws IOException
}
});
if (deletionSuccessful.get()) {
logger.info("Deleting stale metadata file {} from remote segment store", metadataFile);
logger.trace("Deleting stale metadata file {} from remote segment store", metadataFile);
remoteMetadataDirectory.deleteFile(metadataFile);
}
}
Expand Down

0 comments on commit 14a8a99

Please sign in to comment.