Package org.opensearch.index
Class ShardIndexingPressureTracker
java.lang.Object
org.opensearch.index.ShardIndexingPressureTracker
This class is responsible for all the tracking that needs to be performed at every Shard Level for Indexing Operations on the node.
Info is maintained at the granularity of three kinds of write operation (tasks) on the node i.e. coordinating, primary and replica.
This is useful in evaluating the shard indexing back-pressure on the node, to throttle requests and also to publish runtime stats.
There can be four kinds of operation tracking on a node which needs to performed for a shard:
1. Coordinating Operation : To track all the individual shard bulk request on the coordinator node.
2. Primary Operation : To track all the individual shard bulk request on the primary node.
3. Replica Operation : To track all the individual shard bulk request on the replica node.
4. Common Operation : To track values applicable across the specific shard role.
ShardIndexingPressureTracker therefore provides the construct to track all the write requests targeted for a ShardId on the node,
across all possible transport-write-actions i.e. Coordinator, Primary and Replica.
Tracker is uniquely identified against a Shard-Id on the node. Currently the knowledge of shard roles (such as primary vs replica)
is not explicit to the tracker, and it is able to track different values simultaneously based on the interaction hooks of the
operation type i.e. write-action layers.
There is room for introducing more unique identity to the trackers based on Shard-Role or Shard-Allocation-Id, but that will also
increase the complexity of handling shard-lister events and handling other race scenarios such as request-draining etc.
To prefer simplicity we have modelled by keeping explicit fields for different operation tracking, while tracker by itself is
agnostic of the actual shard role.
- Opensearch.internal:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Common operation tracker is used to track values applicable across the operations for a specific shard role.static class
OperationTracker bundles the different kind of attributes which needs to be tracked for every operation, per shard: a.static class
Performance Tracker is used to track the request performance statistics for every operation, per shard.static class
RejectionTracker allows tracking the rejection statistics per shard.static class
StatsTracker is used to track request level aggregated statistics for a shard. -
Constructor Summary
ConstructorsConstructorDescriptionShardIndexingPressureTracker
(ShardId shardId, long initialPrimaryAndCoordinatingLimits, long initialReplicaLimits) -
Method Summary
Modifier and TypeMethodDescriptionboolean
compareAndSetPrimaryAndCoordinatingLimits
(long expectedValue, long newValue) boolean
compareAndSetReplicaLimits
(long expectedValue, long newValue) long
long
-
Constructor Details
-
ShardIndexingPressureTracker
public ShardIndexingPressureTracker(ShardId shardId, long initialPrimaryAndCoordinatingLimits, long initialReplicaLimits)
-
-
Method Details
-
getShardId
-
getPrimaryAndCoordinatingLimits
public long getPrimaryAndCoordinatingLimits() -
compareAndSetPrimaryAndCoordinatingLimits
public boolean compareAndSetPrimaryAndCoordinatingLimits(long expectedValue, long newValue) -
getReplicaLimits
public long getReplicaLimits() -
compareAndSetReplicaLimits
public boolean compareAndSetReplicaLimits(long expectedValue, long newValue) -
getCoordinatingOperationTracker
-
getPrimaryOperationTracker
-
getReplicaOperationTracker
-
getCommonOperationTracker
-