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 (#408) (#420)

Signed-off-by: Sai Kumar <[email protected]>
(cherry picked from commit 385dcb7)
  • Loading branch information
saikaranam-amazon authored and github-actions[bot] committed Jun 3, 2022
1 parent 0c9e882 commit b1ea87b
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 b1ea87b

Please sign in to comment.