Skip to content

Commit

Permalink
Added error logs for replication state transition to auto_pause or fa…
Browse files Browse the repository at this point in the history
…iled state with reason (opensearch-project#408)

Signed-off-by: Sai Kumar <[email protected]>
  • Loading branch information
saikaranam-amazon committed Jun 3, 2022
1 parent 02b0eb3 commit a4476d2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}"),
Expand Down

0 comments on commit a4476d2

Please sign in to comment.