Skip to content

Add extension points to remediate index metadata in during snapshot restore #131706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbaiera
Copy link
Member

@jbaiera jbaiera commented Jul 22, 2025

Adds a new SPI to allow plugins to hook into the snapshot restore process in order to remediate index metadata before accepting it into the cluster state.

@jbaiera jbaiera requested a review from a team as a code owner July 22, 2025 16:12
@jbaiera jbaiera added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v9.2.0 v9.1.1 labels Jul 22, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Jul 22, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @jbaiera, I've created a changelog YAML for you.

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Production change seems fine to me. However I don't think SnapshotResiliencyTests are quite the right place for this. Instead, could we add a test case to RestoreSnapshotIT (or maybe another AbstractSnapshotIntegTestCase?) covering this specific change. I'd want us to be injecting the transformer via a plugin (i.e. overriding org.elasticsearch.test.ESIntegTestCase#nodePlugins).

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Oh yes also this is a very temporary change right? We can drop it as soon as all the affected snapshots have expired. It'd be worth mentioning this in the javadocs.


import org.elasticsearch.cluster.metadata.IndexMetadata;

public interface IndexMetadataRestoreTransformer {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add javadocs for this interface?

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 >enhancement serverless-linked Added by automation, don't add manually Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.1 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants