Skip to content

Commit c2a40c1

Browse files
authored
fix for sync up job not working in 2.17 when upgraded from previous versions (opensearch-project#3241)
* fix for sync up job not working in 2.17 when upgraded from previous versions Signed-off-by: Bhavana Goud Ramaram <[email protected]> * add sync-up job in missing places Signed-off-by: Bhavana Goud Ramaram <[email protected]> --------- Signed-off-by: Bhavana Goud Ramaram <[email protected]>
1 parent e7e0dff commit c2a40c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ private void triggerAutoDeployModels(List<String> addedNodes) {
186186
modelAutoRedeployArrangements.add(modelAutoRedeployArrangement);
187187
});
188188
redeployAModel();
189+
} else {
190+
log.info("Could not find any models in the index, not performing auto reloading!");
191+
startCronjobAndClearListener();
192+
return;
189193
}
190194
}, e -> {
191195
if (e instanceof IndexNotFoundException) {
@@ -261,6 +265,7 @@ private void queryRunningModels(ActionListener<SearchResponse> listener) {
261265
private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeployArrangement) {
262266
if (modelAutoRedeployArrangement == null) {
263267
log.info("No more models in arrangement, skipping the redeployment");
268+
startCronjobAndClearListener();
264269
return;
265270
}
266271
String modelId = modelAutoRedeployArrangement.getSearchResponse().getId();
@@ -275,10 +280,12 @@ private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeploy
275280
"Model function_name or algorithm is null, model is not in correct status, please check the model, model id is: {}",
276281
modelId
277282
);
283+
redeployAModel();
278284
return;
279285
}
280286
if (FunctionName.REMOTE == FunctionName.from(functionName)) {
281287
log.info("Skipping redeploying remote model {} as remote model deployment can be done at prediction time.", modelId);
288+
redeployAModel();
282289
return;
283290
}
284291
List<String> planningWorkerNodes = (List<String>) sourceAsMap.get(MLModel.PLANNING_WORKER_NODES_FIELD);
@@ -302,6 +309,7 @@ private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeploy
302309
.info(
303310
"Allow custom deployment plan is true and deploy to all nodes is false and added nodes are not in planning worker nodes list, not to auto redeploy the model to the new nodes!"
304311
);
312+
redeployAModel();
305313
return;
306314
}
307315

0 commit comments

Comments
 (0)