From f8e001f314e94d602aaca8356c40ebda334d2b70 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Fri, 6 Jan 2023 09:30:28 -0800 Subject: [PATCH] Update warn logs in isSegmentReplicationAllowed. Signed-off-by: Marc Handalian --- .../main/java/org/opensearch/index/shard/IndexShard.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 7abbc6148eeb3..216ee384f15c9 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -1445,21 +1445,22 @@ public ReplicationCheckpoint getLatestReplicationCheckpoint() { */ public boolean isSegmentReplicationAllowed() { if (indexSettings.isSegRepEnabled() == false) { + logger.warn("Attempting to perform segment replication when it is not enabled on the index"); return false; } if (getReplicationTracker().isPrimaryMode()) { - logger.warn("Ignoring new replication checkpoint - shard is in primaryMode and cannot receive any checkpoints."); + logger.warn("Shard is in primary mode and cannot perform segment replication as a replica."); return false; } if (this.routingEntry().primary()) { - logger.warn("Ignoring new replication checkpoint - primary shard cannot receive any checkpoints."); + logger.warn("Shard is marked as primary and cannot perform segment replication as a replica"); return false; } if (state().equals(IndexShardState.STARTED) == false && (state() == IndexShardState.POST_RECOVERY && shardRouting.state() == ShardRoutingState.INITIALIZING) == false) { logger.warn( () -> new ParameterizedMessage( - "Ignoring new replication checkpoint - shard is not started or recovering {} {}", + "Shard is not started or recovering {} {} and cannot perform segment replication as a replica", state(), shardRouting.state() ) @@ -1469,7 +1470,7 @@ public boolean isSegmentReplicationAllowed() { if (getReplicationEngine().isEmpty()) { logger.warn( () -> new ParameterizedMessage( - "Ignoring checkpoint, attempting to perform segrep with wrong engine type {}", + "Shard does not have the correct engine type to perform segment replication {}.", getEngine().getClass() ) );