Skip to content

Conversation

@ywangd
Copy link
Member

@ywangd ywangd commented Nov 20, 2025

This PR extract a base class from SnapshotShardContext so that a different implementation can be provided by plugins. It also adds a SnapshotShardContextFactory interface to encapsulates its creation process so that it is pluggable as well. The PR also split the cluster management code from SnapshotStressTestsIT and makes it reusable elsewhere.

Relates: ES-13454

@ywangd ywangd requested a review from a team as a code owner November 20, 2025 06:28
@ywangd ywangd added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >refactoring v9.3.0 labels Nov 20, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Nov 20, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

Comment on lines +291 to +297
protected int numberOfReplicasUpperBound() {
return cluster.numDataNodes() - 1;
}

public void run() throws InterruptedException {
run(true, true);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This entire class is almost extracted as is from SnapshotStressTestsIT except this two methods:

  1. numberOfReplicasUpperBound() is overriden in stateless so that it returns a number based on the number of search nodes.
  2. The two boolean flags are to control whether restart and shutdown are enabled in the test. I added them when debugging through issues to avoid too many variables. They are no longer used anywhere. But I intend to keep them since I may need them again in future when adding more stateless features.

@ywangd ywangd removed the request for review from a team November 20, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >refactoring Team:Distributed Coordination Meta label for Distributed Coordination team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants