-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Make system index migration project-aware #132650
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
570845a
Make system index migration project-aware
nielsbauman 31fe5fd
Rename test method
nielsbauman 8efdc38
Merge branch 'main' into system-migration-mp
nielsbauman 6da067a
Merge branch 'main' into system-migration-mp
nielsbauman b065c3c
Merge branch 'main' into system-migration-mp
nielsbauman 1525c74
Merge branch 'main' into system-migration-mp
nielsbauman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1008,18 +1008,13 @@ public static void cleanUpFeature( | |
| } | ||
|
|
||
| // No-op pre-migration function to be used as the default in case none are provided. | ||
| private static void noopPreMigrationFunction( | ||
| ClusterService clusterService, | ||
| Client client, | ||
| ActionListener<Map<String, Object>> listener | ||
| ) { | ||
| private static void noopPreMigrationFunction(ProjectMetadata project, Client client, ActionListener<Map<String, Object>> listener) { | ||
| listener.onResponse(Collections.emptyMap()); | ||
| } | ||
|
|
||
| // No-op pre-migration function to be used as the default in case none are provided. | ||
| private static void noopPostMigrationFunction( | ||
| Map<String, Object> preUpgradeMetadata, | ||
| ClusterService clusterService, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of the post migration functions need a cluster service, so I assumed it was fine to just remove the parameter (instead of passing an explicit |
||
| Client client, | ||
| ActionListener<Boolean> listener | ||
| ) { | ||
|
|
@@ -1028,25 +1023,20 @@ private static void noopPostMigrationFunction( | |
|
|
||
| /** | ||
| * Type for the handler that's invoked prior to migrating a Feature's system indices. | ||
| * See {@link SystemIndexPlugin#prepareForIndicesMigration(ClusterService, Client, ActionListener)}. | ||
| * See {@link SystemIndexPlugin#prepareForIndicesMigration(ProjectMetadata, Client, ActionListener)}. | ||
| */ | ||
| @FunctionalInterface | ||
| public interface MigrationPreparationHandler { | ||
| void prepareForIndicesMigration(ClusterService clusterService, Client client, ActionListener<Map<String, Object>> listener); | ||
| void prepareForIndicesMigration(ProjectMetadata project, Client client, ActionListener<Map<String, Object>> listener); | ||
| } | ||
|
|
||
| /** | ||
| * Type for the handler that's invoked when all of a feature's system indices have been migrated. | ||
| * See {@link SystemIndexPlugin#indicesMigrationComplete(Map, ClusterService, Client, ActionListener)}. | ||
| * See {@link SystemIndexPlugin#indicesMigrationComplete(Map, Client, ActionListener)}. | ||
| */ | ||
| @FunctionalInterface | ||
| public interface MigrationCompletionHandler { | ||
| void indicesMigrationComplete( | ||
| Map<String, Object> preUpgradeMetadata, | ||
| ClusterService clusterService, | ||
| Client client, | ||
| ActionListener<Boolean> listener | ||
| ); | ||
| void indicesMigrationComplete(Map<String, Object> preUpgradeMetadata, Client client, ActionListener<Boolean> listener); | ||
| } | ||
|
|
||
| public interface CleanupFunction { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of pushing the
ClusterServicedown and resolving the project in a downstream method, I chose to move the resolution up and pass an explicitProjectMetadata. This seemed fine, as the downstream method that used to do the resolution did the resolution as the first thing.