From 83abb37f54e2947aea0552acfd770a9d14d5ca02 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 16 Oct 2023 11:10:04 +0100 Subject: [PATCH] [ML] Use correct writable name for model assignment metadata in mixed cluster (#100886) Older nodes will fail if they do not recognise the named writable --- docs/changelog/100886.yaml | 5 +++++ .../inference/assignment/TrainedModelAssignmentMetadata.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/100886.yaml diff --git a/docs/changelog/100886.yaml b/docs/changelog/100886.yaml new file mode 100644 index 0000000000000..b926f924c7a7c --- /dev/null +++ b/docs/changelog/100886.yaml @@ -0,0 +1,5 @@ +pr: 100886 +summary: Use the correct writable name for model assignment metadata in mixed version clusters. Prevents a node failure due to IllegalArgumentException Unknown NamedWriteable [trained_model_assignment] +area: Machine Learning +type: bug +issues: [] diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java index 8391d287a6847..aabedfc4351b5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java @@ -309,7 +309,8 @@ private TrainedModeAssignmentDiff(final StreamInput in, String writeableName) th @Override public Metadata.Custom apply(Metadata.Custom part) { return new TrainedModelAssignmentMetadata( - new TreeMap<>(modelRoutingEntries.apply(((TrainedModelAssignmentMetadata) part).deploymentRoutingEntries)) + new TreeMap<>(modelRoutingEntries.apply(((TrainedModelAssignmentMetadata) part).deploymentRoutingEntries)), + writeableName ); }