From b18cd49bddb056bb8d78b3485010201f05b82e32 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 22:03:15 -0700 Subject: [PATCH] [Segment Replication] Mute segment replication pressure ITs (#6672) (#6673) * Mute segment replication pressure ITs * Log warnings only when out of sync allocation ids --------- (cherry picked from commit 535942e9cd40c263ea749366cb8e53932ddd9f61) Signed-off-by: Suraj Singh Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../org/opensearch/index/SegmentReplicationPressureIT.java | 2 ++ .../indices/replication/OngoingSegmentReplications.java | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java b/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java index 1ecc1fd2c1955..ee5150c97fb4f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java @@ -57,6 +57,7 @@ protected Collection> nodePlugins() { return asList(MockTransportService.TestPlugin.class); } + @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/6671") public void testWritesRejected() throws Exception { final String primaryNode = internalCluster().startNode(); createIndex(INDEX_NAME); @@ -97,6 +98,7 @@ public void testWritesRejected() throws Exception { * This test ensures that a replica can be added while the index is under write block. * Ensuring that only write requests are blocked. */ + @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/6671") public void testAddReplicaWhileWritesBlocked() throws Exception { final String primaryNode = internalCluster().startNode(); createIndex(INDEX_NAME); diff --git a/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java b/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java index 5a23bfff7c040..60078c082a7e3 100644 --- a/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java +++ b/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java @@ -41,6 +41,8 @@ * @opensearch.internal */ class OngoingSegmentReplications { + + private static final Logger logger = LogManager.getLogger(OngoingSegmentReplications.class); private final RecoverySettings recoverySettings; private final IndicesService indicesService; private final Map copyStateMap; @@ -95,8 +97,6 @@ synchronized CopyState getCachedCopyState(ReplicationCheckpoint checkpoint) thro } } - private static final Logger logger = LogManager.getLogger(OngoingSegmentReplications.class); - /** * Start sending files to the replica. * @@ -269,6 +269,9 @@ private void cancelHandlers(Predicate p .filter(predicate) .map(SegmentReplicationSourceHandler::getAllocationId) .collect(Collectors.toList()); + if (allocationIds.size() == 0) { + return; + } logger.warn(() -> new ParameterizedMessage("Cancelling replications for allocationIds {}", allocationIds)); for (String allocationId : allocationIds) { cancel(allocationId, reason);