diff --git a/server/src/main/java/org/opensearch/indices/replication/checkpoint/TransportPublishShardCheckpointAction.java b/server/src/main/java/org/opensearch/indices/replication/checkpoint/TransportPublishShardCheckpointAction.java index 84c4bbb1aaaad..4515d053fa311 100644 --- a/server/src/main/java/org/opensearch/indices/replication/checkpoint/TransportPublishShardCheckpointAction.java +++ b/server/src/main/java/org/opensearch/indices/replication/checkpoint/TransportPublishShardCheckpointAction.java @@ -83,7 +83,11 @@ protected void shardOperationOnReplica(ShardPublishCheckpointRequest shardReques ActionListener.completeWith(listener, () -> { PublishCheckpointRequest request = shardRequest.getRequest(); logger.trace("Checkpoint received on replica {}", request); - replica.onNewCheckpoint(request, source, replicationService); + if (request.getCheckpoint().getShardId().equals(replica.shardId())) { + replica.onNewCheckpoint(request, source, replicationService); + } + // TODO: Segrep - These requests are getting routed to all shards across all indices. + // We should only publish to replicas of the updated index. return new ReplicaResult(); }); }