-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Register Feature migration persistent task state named XContent #84192
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
Register Feature migration persistent task state named XContent #84192
Conversation
Registering SystemIndexMigrationTaskParams and SystemIndexMigrationTaskState parsers into named xcontent registry. closes elastic#84115
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
Hi @pgomulka, I've created a changelog YAML for you. |
…thub.com:pgomulka/elasticsearch into main/systemindexmigration_register_namedxcontent
|
I wonder if the problems from this PR together with #84142 are enough? |
|
Copying the content of our Slack conversation here:
|
| case 2: | ||
| return randomLong(); | ||
| case 3: | ||
| return randomShort(); |
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.
I have removed short and float from there because when serialised/deserialised jackson will read this as integer/double
DaveCTurner
left a comment
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.
Test looks good, I left a couple of suggestions.
...reindex/src/internalClusterTest/java/org/elasticsearch/migration/SystemIndexMigrationIT.java
Outdated
Show resolved
Hide resolved
| AtomicBoolean hasBlocked = new AtomicBoolean(); | ||
|
|
||
| final String masterName = internalCluster().startMasterOnlyNode(); | ||
| final String dataNodeName = internalCluster().startDataOnlyNode(); |
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.
I think I called this a "data node" when discussing the test but in fact it would be preferable to test it for master nodes. E.g. #84148 would drop the bad metadata on non-master nodes so this test wouldn't do anything any more.
…/migration/SystemIndexMigrationIT.java Co-authored-by: David Turner <[email protected]>
…thub.com:pgomulka/elasticsearch into main/systemindexmigration_register_namedxcontent
| import static org.hamcrest.Matchers.equalTo; | ||
| import static org.hamcrest.Matchers.is; | ||
|
|
||
| public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase { |
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.
all of these tests share the same setup, so I think it is better they have it in one abstract class common to them all, rather than extending from the base test (I don't think MultiFeatureMigrationIT was meant to run tests from FeatureMigrationIT, but maybe @gwbrown can confirm?)
I was considering moving this all to utility class, but I also want to make sure that cleanup of static hooks (preMigrationHook and postMigrationHook ) is performed before every test. I had a failure due to lack of this cleanup https://gradle-enterprise.elastic.co/s/z75xl73xezq36/tests/:modules:reindex:internalClusterTest/org.elasticsearch.migration.SystemIndexMigrationIT/testSystemIndexMigrationCanBeInterruptedWithShutdown?top-execution=1
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.
Extracting this to a separate class is quite reasonable. MultiFeatureMigrationIT was to some degree intended to run the tests from FeatureMigrationIT as well as its own, but it's very possible that's not the best way to handle that, and I don't think we lose much test coverage as the test in MultiFeatureMigrationIT should cover those cases alright.
++ to adding automatic cleanup, we should have had it to start with.
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
…tic#84192) This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which elastic#84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]> (cherry picked from commit 4c3b7b1)
…tic#84192) This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which elastic#84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]> (cherry picked from commit 4c3b7b1)
This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which #84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]> (cherry picked from commit 4c3b7b1) Co-authored-by: Przemyslaw Gomulka <[email protected]>
…tic#84192) This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which elastic#84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]> (cherry picked from commit 4c3b7b1)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
A follow up after elastic#84192 - refactor the static state in TestPlugin to be an instance - refactor assertions to use hamcrest - remove Simple from methods as it is not meaningful - refactor xcontent tests to support unknown fields closes elastic#84245
…tic#84192) This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which elastic#84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]>
This PR properly registers `NamedXContentRegistry` entries for `SystemIndexMigrationTaskParams` and `SystemIndexMigrationTaskState`. It also adds tests for the XContent de/serialization for those classes, and fixes a bug revealed by these tests in `SystemIndexMigrationTaskState`'s parser. Finally, it adds an integration test which simulates the conditions in which #84115 occurs: A node restart while the migration is in progress. This ensures that we have fixed that particular bug. Co-authored-by: David Turner <[email protected]> Co-authored-by: Gordon Brown <[email protected]> Co-authored-by: Przemyslaw Gomulka <[email protected]>
A follow up after elastic#84192 refactor the static state in TestPlugin to be an instance refactor assertions to use hamcrest remove Simple from methods as it is not meaningful refactor xcontent tests to support unknown fields closes elastic#84245
A follow up after elastic#84192 refactor the static state in TestPlugin to be an instance refactor assertions to use hamcrest remove Simple from methods as it is not meaningful refactor xcontent tests to support unknown fields closes elastic#84245
A follow up after elastic#84192 refactor the static state in TestPlugin to be an instance refactor assertions to use hamcrest remove Simple from methods as it is not meaningful refactor xcontent tests to support unknown fields closes elastic#84245
This PR properly registers
NamedXContentRegistryentries forSystemIndexMigrationTaskParamsandSystemIndexMigrationTaskState. It also adds tests for the XContent de/serialization for those classes,and fixes a bug revealed by these tests in
SystemIndexMigrationTaskState's parser.Finally, it adds an integration test which simulates the conditions in which #84115 occurs: A node restart
while the migration is in progress. This ensures that we have fixed that particular bug.
Closes #84115
To add context for anyone looking at this fix as it applies to #84115 which is currently occurring in a
live cluster: Because this fix only changes how these classes are read, not how they are written,
installing a version which includes this fix should be sufficient to allow the impacted nodes to start.