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 abe0471d5251c..26ed84a563faa 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -3231,7 +3231,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));