From af3b9ec92a95a346858d448c46fdf49d0d960d4b Mon Sep 17 00:00:00 2001 From: Poojita Raj Date: Wed, 13 Apr 2022 11:21:27 -0700 Subject: [PATCH] fix - replica shards trying to send replica checkpoints (#2889) Signed-off-by: Poojita Raj --- server/src/main/java/org/opensearch/index/shard/IndexShard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0cb4c528f460b..6732359b22dd7 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -3234,7 +3234,7 @@ private EngineConfig newEngineConfig(LongSupplier globalCheckpointSupplier) { } }; final List internalRefreshListener; - if (indexSettings.isSegrepEnabled()) { + if (indexSettings.isSegrepEnabled() && shardRouting.primary()) { internalRefreshListener = Arrays.asList(new RefreshMetricUpdater(refreshMetric), checkpointRefreshListener); } else { internalRefreshListener = Collections.singletonList(new RefreshMetricUpdater(refreshMetric));