diff --git a/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java b/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java index 9e2fbb7133..0ff6754e6b 100644 --- a/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java +++ b/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java @@ -39,6 +39,7 @@ public class MLModelGroup implements ToXContentObject { @Setter private String name; private String description; + @Setter private int latestVersion; private List backendRoles; private User owner; diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java index bb7ee6ca53..e69d494d3b 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java @@ -221,6 +221,7 @@ private void updateModelWithRegisteringNewModelGroup( mlModelGroupManager.getModelGroup(newModelGroupId, ActionListener.wrap(newModelGroup -> { String updatedVersion = incrementLatestVersion(newModelGroup); updateModelInput.setVersion(updatedVersion); + newModelGroup.setLatestVersion(Integer.parseInt(updatedVersion)); updateRequestConstructor(modelId, updateRequest, updateModelInput, actionListener); }, exception -> actionListener