-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[ML] Don't install empty ML metadata on startup #30751
[ML] Don't install empty ML metadata on startup #30751
Conversation
This change is to support rolling upgrade from a pre-6.3 default distribution (i.e. without X-Pack) to a 6.3+ default distribution (i.e. with X-Pack). The ML metadata is no longer eagerly added to the cluster state as soon as the master node has X-Pack available. Instead, it is added when the first ML job is created. As a result all methods that get the ML metadata need to be able to handle the situation where there is no ML metadata in the current cluster state. They do this by behaving as though an empty ML metadata was present. This logic is encapsulated by always asking for the current ML metadata using a static method on the MlMetadata class. Relates elastic#30731
Pinging @elastic/ml-core |
@@ -132,15 +131,7 @@ public boolean enabled() { | |||
@Override | |||
public void usage(ActionListener<XPackFeatureSet.Usage> listener) { | |||
ClusterState state = clusterService.state(); | |||
MlMetadata mlMetadata = state.getMetaData().custom(MLMetadataField.TYPE); | |||
|
|||
// Handle case when usage is called but MlMetadata has not been installed yet |
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.
It was never really worth handling this case differently to ML metadata existing but being empty, as this state only existed for a fraction of a second on first cluster startup. Now this state will exist for longer - until the first job is created - but handling it like empty ML metadata is actually closer to the historical behaviour.
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 This is so much cleaner!
This change is to support rolling upgrade from a pre-6.3 default distribution (i.e. without X-Pack) to a 6.3+ default distribution (i.e. with X-Pack). The ML metadata is no longer eagerly added to the cluster state as soon as the master node has X-Pack available. Instead, it is added when the first ML job is created. As a result all methods that get the ML metadata need to be able to handle the situation where there is no ML metadata in the current cluster state. They do this by behaving as though an empty ML metadata was present. This logic is encapsulated by always asking for the current ML metadata using a static method on the MlMetadata class. Relates #30731
This change is to support rolling upgrade from a pre-6.3 default distribution (i.e. without X-Pack) to a 6.3+ default distribution (i.e. with X-Pack). The ML metadata is no longer eagerly added to the cluster state as soon as the master node has X-Pack available. Instead, it is added when the first ML job is created. As a result all methods that get the ML metadata need to be able to handle the situation where there is no ML metadata in the current cluster state. They do this by behaving as though an empty ML metadata was present. This logic is encapsulated by always asking for the current ML metadata using a static method on the MlMetadata class. Relates #30731
…ne-liners * elastic/master: [TEST] Enable DEBUG logging on testAutoQueueSizingWithMax [ML] Don't install empty ML metadata on startup (elastic#30751) Add assertion on removing copy_settings (elastic#30748) bump lucene version for 6_3_0 [DOCS] Mark painless execute api as experimental (elastic#30710) disable annotation processor for docs (elastic#30610) Add more script contexts (elastic#30721) Fix default shards count in create index docs (elastic#30747)
* master: Reduce CLI scripts to one-liners (#30759) SQL: Preserve scoring in bool queries (#30730) QA: Switch rolling upgrade to 3 nodes (#30728) [TEST] Enable DEBUG logging on testAutoQueueSizingWithMax [ML] Don't install empty ML metadata on startup (#30751) Add assertion on removing copy_settings (#30748) bump lucene version for 6_3_0 [DOCS] Mark painless execute api as experimental (#30710) disable annotation processor for docs (#30610) Add more script contexts (#30721) Fix default shards count in create index docs (#30747) Mute testCorruptFileThenSnapshotAndRestore
* es/ccr: (50 commits) Reduce CLI scripts to one-liners (elastic#30759) SQL: Preserve scoring in bool queries (elastic#30730) QA: Switch rolling upgrade to 3 nodes (elastic#30728) [TEST] Enable DEBUG logging on testAutoQueueSizingWithMax [ML] Don't install empty ML metadata on startup (elastic#30751) Add assertion on removing copy_settings (elastic#30748) bump lucene version for 6_3_0 [DOCS] Mark painless execute api as experimental (elastic#30710) disable annotation processor for docs (elastic#30610) Add more script contexts (elastic#30721) Fix default shards count in create index docs (elastic#30747) Mute testCorruptFileThenSnapshotAndRestore Scripting: Remove getDate methods from ScriptDocValues (elastic#30690) Upgrade to Lucene-7.4.0-snapshot-59f2b7aec2 (elastic#30726) [Docs] Fix single page :docs:check invocation (elastic#30725) Docs: Add uptasticsearch to list of clients (elastic#30738) [DOCS] Removes out-dated x-pack/docs/en/index.asciidoc [DOCS] Removes redundant index.asciidoc files (elastic#30707) [TEST] Reduce forecast overflow to disk test memory limit (elastic#30727) Plugins: Remove meta plugins (elastic#30670) ...
This change is to support rolling upgrade from a pre-6.3 default
distribution (i.e. without X-Pack) to a 6.3+ default distribution
(i.e. with X-Pack).
The ML metadata is no longer eagerly added to the cluster state
as soon as the master node has X-Pack available. Instead, it
is added when the first ML job is created.
As a result all methods that get the ML metadata need to be able
to handle the situation where there is no ML metadata in the
current cluster state. They do this by behaving as though an
empty ML metadata was present. This logic is encapsulated by
always asking for the current ML metadata using a static method
on the MlMetadata class.
Relates #30731