diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/shrink/WaitForShrinkStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/shrink/WaitForShrinkStep.kt index d3095641c..33c7fb111 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/shrink/WaitForShrinkStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/shrink/WaitForShrinkStep.kt @@ -149,10 +149,10 @@ class WaitForShrinkStep(private val action: ShrinkAction) : ShrinkStep(name, tru val response: AcknowledgedResponse = context.client.admin().indices().suspendUntil { aliases(req, it) } if (response.isAcknowledged) { logger.info("Aliases switched successfully from [$sourceIndexName] to [$targetIndexName].") - return true + } else { + logger.error("Switching aliases from [$sourceIndexName] to [$targetIndexName] failed.") } - logger.error("Switching aliases from [$sourceIndexName] to [$targetIndexName] failed.") - return false + response.isAcknowledged } catch (e: Exception) { logger.error("Switching aliases from [$sourceIndexName] to [$targetIndexName] failed due to exception.", e) false