fix #2531 check reindex status

This commit is contained in:
Shinsuke Sugaya 2021-02-18 06:53:37 +09:00
parent 695d35aa76
commit 81f144c75f

View file

@ -309,9 +309,10 @@ public class AdminMaintenanceAction extends FessAdminAction {
if (searchEngineClient.createIndex(docIndex, toIndex, numberOfShards, autoExpandReplicas, resetDictionaries)) {
searchEngineClient.admin().cluster().prepareHealth(toIndex).setWaitForYellowStatus().execute(ActionListener.wrap(response -> {
searchEngineClient.addMapping(docIndex, "doc", toIndex);
searchEngineClient.reindex(fromIndex, toIndex, replaceAliases);
if (replaceAliases && !searchEngineClient.updateAlias(toIndex)) {
logger.warn("Failed to update aliases for {} and {}", fromIndex, toIndex);
if (searchEngineClient.reindex(fromIndex, toIndex, replaceAliases)) {
if (replaceAliases && !searchEngineClient.updateAlias(toIndex)) {
logger.warn("Failed to update aliases for {} and {}", fromIndex, toIndex);
}
}
}, e -> logger.warn("Failed to reindex from {} to {}", fromIndex, toIndex, e)));
return true;