Skip to content

Add recovery gate to GET /_recovery response - #158774

Draft
samxbr wants to merge 3 commits into
elastic:mainfrom
samxbr:recovery/gate-recovery-api
Draft

Add recovery gate to GET /_recovery response#158774
samxbr wants to merge 3 commits into
elastic:mainfrom
samxbr:recovery/gate-recovery-api

Conversation

@samxbr

@samxbr samxbr commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This change exposes a new optional field gate to the response of the GET /_recovery API, showing the name of the recovery gate blocking shard recovery. Notable changes:

  • TransportRecoveryAction captures a snapshot of pending recoveries and gate from ThrottlingRecoveryService as nodeContext to to construct the shard level response
  • The RecoveryState returned in RecoveryResponse is wrapped in a new ShardRecoveryInfo, to include the node level recovery gate

Relates to https://github.com/elastic/elasticsearch-team/issues/4477

Comment on lines 68 to +72
public Map<String, List<RecoveryState>> shardRecoveryStates() {
return shardRecoveryStates;
return Maps.transformValues(
shardRecoveryInfos,
infos -> infos.stream().map(ShardRecoveryInfo::recoveryState).collect(Collectors.toCollection(ArrayList::new))
);

@samxbr samxbr Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should just return Map<String, List<ShardRecoveryInfo>>, but there are too many references and will make this PR difficult to review, I will refactor this in a follow-up.

@samxbr samxbr added :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >non-issue labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >non-issue v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants