Skip to content

Commit

Permalink
Update warn logs in isSegmentReplicationAllowed.
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Jan 6, 2023
1 parent d22f9ac commit f8e001f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand All @@ -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()
)
);
Expand Down

0 comments on commit f8e001f

Please sign in to comment.