Replica shards are also monitored to determine whether the shards are stuck or lagging for an extended period of time. When replica shards are stuck or lagging for more than double the amount of time defined by the MAX_REPLICATION_TIME_SETTING field, the shards are removed and replaced with new replica shards.

You can use the segment replication API endpoint to retrieve segment replication backpressure metrics as follows:

Example response

  1. [index-1][0] runTask-1 127.0.0.1 0 0b 0s 7ms 0

The checkpoints_behind and current_lag metrics are taken into consideration when initiating segment replication backpressure. They are checked against MAX_INDEXING_CHECKPOINTS and MAX_REPLICATION_TIME_SETTING, respectively.