Skip to content

Commit 5eef3ea

Browse files
committed
[7.x][ML] Correcting model state min_version
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. Backport of elastic#1546
1 parent 23ff0bf commit 5eef3ea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/CHANGELOG.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
* Avoid potential "Failed to compute quantile" and "No values added to quantile sketch" log errors
5353
training regression and classification models if there are features with mostly missing values.
5454
(See {ml-pull}1500[#1500].)
55+
* Correct the anomaly detection job model state `min_version`. (See {ml-pull}1546[#1546].)
5556

5657
== {es} version 7.9.2
5758

lib/api/CAnomalyJob.cc

+6-1
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)