Skip to content

Commit

Permalink
[Segment Replication] Mute segment replication pressure ITs (opensear…
Browse files Browse the repository at this point in the history
…ch-project#6672)

* Mute segment replication pressure ITs

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Log warnings only when out of sync allocation ids

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Suraj Singh <surajrider@gmail.com>
  • Loading branch information
dreamer-89 authored Mar 15, 2023
1 parent 6babc08 commit 535942e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected Collection<Class<? extends Plugin>> 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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReplicationCheckpoint, CopyState> copyStateMap;
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -269,6 +269,9 @@ private void cancelHandlers(Predicate<? super SegmentReplicationSourceHandler> 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);
Expand Down

0 comments on commit 535942e

Please sign in to comment.