Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ private void finishRequest() {

@Override
protected Releasable checkPrimaryLimits(BulkShardRequest request, boolean rerouteWasLocal, boolean localRerouteInitiatedByNodeClient) {
if (force(request) == false) {
if (force(request) == false && isWarmNode == false) {
if (segmentReplicationPressureService.isSegmentReplicationBackpressureEnabled()) {
segmentReplicationPressureService.isSegrepLimitBreached(request.shardId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;

import static org.opensearch.cluster.node.DiscoveryNode.isWarmNode;

/**
* Base class for requests that should be executed on a primary copy followed by replica copies.
* Subclasses can resolve the target shard and provide implementation for primary and replica operations.
Expand Down Expand Up @@ -151,6 +153,7 @@ public abstract class TransportReplicationAction<
protected final TransportRequestOptions transportOptions;
protected final String executor;
protected final boolean forceExecutionOnPrimary;
protected final boolean isWarmNode;

// package private for testing
protected final String transportReplicaAction;
Expand Down Expand Up @@ -253,6 +256,7 @@ protected TransportReplicationAction(
this.initialRetryBackoffBound = REPLICATION_INITIAL_RETRY_BACKOFF_BOUND.get(settings);
this.retryTimeout = getRetryTimeoutSetting().get(settings);
this.forceExecutionOnPrimary = forceExecutionOnPrimary;
this.isWarmNode = isWarmNode(settings);

transportService.registerRequestHandler(actionName, ThreadPool.Names.SAME, requestReader, this::handleOperationRequest);

Expand Down
Loading