Skip to content

Commit 2da1d33

Browse files
author
David Roberts
authored
[ML] Correcting model state min_version (#1546)
The model state min_version should indicate the minimum node version required to restore the model state. This has not been updated since 6.4.0, meaning we have not had the intended protection against model states being used on nodes that are too old. This change updates the min_version to the correct version at present, which is 7.9.0 for latest state. Relates #1545
1 parent 7d1e67b commit 2da1d33

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
* Avoid potential "Failed to compute quantile" and "No values added to quantile sketch" log errors
6464
training regression and classification models if there are features with mostly missing values.
6565
(See {ml-pull}1500[#1500].)
66+
* Correct the anomaly detection job model state `min_version`. (See {ml-pull}1546[#1546].)
6667

6768
== {es} version 7.9.2
6869

lib/api/CAnomalyJob.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ const std::string INTERIM_BUCKET_CORRECTOR_TAG("k");
8585

8686
//! The minimum version required to read the state corresponding to a model snapshot.
8787
//! This should be updated every time there is a breaking change to the model state.
88-
const std::string MODEL_SNAPSHOT_MIN_VERSION("6.4.0");
88+
//! Newer versions are able to read the model state of older versions, but older
89+
//! versions cannot read the model state of newer versions following a breaking
90+
//! change. This constant tells the node assignment code not to load new model states
91+
//! on old nodes in a mixed version cluster. (The last breaking change was in 7.9 in
92+
//! lib/core/CPackedBitVector.cc in https://github.com/elastic/ml-cpp/pull/1340.)
93+
const std::string MODEL_SNAPSHOT_MIN_VERSION("7.9.0");
8994

9095
//! Persist state as JSON with meaningful tag names.
9196
class CReadableJsonStatePersistInserter : public core::CJsonStatePersistInserter {

0 commit comments

Comments
 (0)