From 4bfc6fcb8e7b154d5902abeaf3cdf447c04e4512 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 3 Jun 2022 19:37:24 +0530 Subject: [PATCH] Added error logs for replication state transition to auto_pause or failed state with reason (#408) (#420) Signed-off-by: Sai Kumar (cherry picked from commit 385dcb72009c820a3b8ab5e1bece6ab1da7e682f) --- .../opensearch/replication/task/index/IndexReplicationTask.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt index 471972e9..7b664407 100644 --- a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt +++ b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt @@ -265,6 +265,7 @@ open class IndexReplicationTask(id: Long, type: String, action: String, descript private suspend fun failReplication(failedState: FailedState) { withContext(NonCancellable) { val reason = failedState.errorMsg + log.error("Moving replication[IndexReplicationTask:$id][reason=${reason}] to failed state") try { replicationMetadataManager.updateIndexReplicationState( followerIndexName, @@ -620,7 +621,7 @@ open class IndexReplicationTask(id: Long, type: String, action: String, descript private suspend fun pauseReplication(state: FailedState): IndexReplicationState { try { - log.info("Going to initiate auto-pause of $followerIndexName due to shard failures - $state") + log.error("Going to initiate auto-pause of $followerIndexName due to shard failures - $state") val pauseReplicationResponse = client.suspendExecute( replicationMetadata, PauseIndexReplicationAction.INSTANCE, PauseIndexReplicationRequest(followerIndexName, "AutoPaused: ${state.errorMsg}"),