-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
[Transform] add transform upgrade endpoint #77566
Conversation
8e97475
to
a93c2de
Compare
fd0aeac
to
ed42c75
Compare
2ec4e19
to
eea9cc0
Compare
b8e5005
to
bf07e9f
Compare
Pinging @elastic/ml-core (Team:ML) |
e3698f7
to
de98187
Compare
...el/src/test/java/org/elasticsearch/client/transform/hlrc/UpgradeTransformsResponseTests.java
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/api/transform.upgrade_transforms.json
Outdated
Show resolved
Hide resolved
"Test upgrade transform": | ||
- do: | ||
transform.upgrade_transforms: | ||
dry_run: false |
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.
Could you also add a test case with dry_run==true?
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.
👍 Note, I have rolling upgrade test in the works (this one will be more meaningful), but I can't check that in as part of this PR, as I 1st need the backport.
DeleteIndexRequest deleteRequest = new DeleteIndexRequest( | ||
TransformInternalIndexConstants.INDEX_NAME_PATTERN, | ||
TransformInternalIndexConstants.INDEX_NAME_PATTERN_DEPRECATED, | ||
"-" + TransformInternalIndexConstants.LATEST_INDEX_VERSIONED_NAME |
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.
Does the minus ("-") sign mean to exclude an index from being deleted?
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.
yes, with -
one can exclude, see Multi-target syntax
...ain/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java
Outdated
Show resolved
Hide resolved
...ain/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java
Outdated
Show resolved
Hide resolved
...ain/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/transform/persistence/InMemoryTransformConfigManager.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/transform/persistence/InMemoryTransformConfigManager.java
Outdated
Show resolved
Hide resolved
844ffd9
to
10c4a27
Compare
8c93ab8
to
21675ce
Compare
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.
My two major concerns:
- How do we recover from the old docs not being deleted after an upgrade?
- How does this behave in multi-node. We recursively upgrade and that could be on a network thread. I don't think we lock anything, and pushing/popping the listeners from that threadpool is probably just fine. Just paranoid.
Overall, this is some good stuff
...ore/src/main/java/org/elasticsearch/xpack/core/transform/action/UpgradeTransformsAction.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/transform/action/UpgradeTransformsAction.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/transform/action/TransportUpgradeTransformsAction.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/transform/action/TransportUpgradeTransformsAction.java
Outdated
Show resolved
Hide resolved
…transform/action/UpgradeTransformsAction.java Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…rch into transform-upgrade
run elasticsearch-ci/part-2 |
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.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
Add an _upgrade endpoint to bulk upgrade transforms. _upgrade rewrites all transforms and its artifacts into the latest format to the latest storage(index). If all transforms are upgraded old indices and outdated documents get deleted. Using the dry_run option it is possible to check if upgrades are necessary without applying changes.
* [Transform] add transform upgrade endpoint (#77566) Add an _upgrade endpoint to bulk upgrade transforms. _upgrade rewrites all transforms and its artifacts into the latest format to the latest storage(index). If all transforms are upgraded old indices and outdated documents get deleted. Using the dry_run option it is possible to check if upgrades are necessary without applying changes. * fix merge conflicts * 7.x requires a different license check
Add an _upgrade endpoint to bulk upgrade transforms.
_upgrade
rewrites all transforms and its artifacts into the latest format to the latest storage(index). If all transforms are upgraded old indices and outdated documents get deleted.Todo: