Skip to content

Commit 29f680f

Browse files
author
Kamal Nayan
committed
Removed unnecessary user notifications for version conflict exceptions in Snapshot Management
Signed-off-by: Kamal Nayan <askkamal@amazon.com>
1 parent a36dc82 commit 29f680f

File tree

1 file changed

+7
-2
lines changed
  • src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine

1 file changed

+7
-2
lines changed

src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import org.opensearch.action.bulk.BackoffPolicy
1111
import org.opensearch.common.settings.Settings
1212
import org.opensearch.common.unit.TimeValue
1313
import org.opensearch.commons.ConfigConstants
14+
import org.opensearch.index.engine.VersionConflictEngineException
1415
import org.opensearch.indexmanagement.IndexManagementIndices
1516
import org.opensearch.indexmanagement.opensearchapi.IndexManagementSecurityContext
1617
import org.opensearch.indexmanagement.opensearchapi.retry
@@ -122,8 +123,12 @@ class SMStateMachine(
122123
}
123124
} while (currentState.instance.continuous && result is SMResult.Next)
124125
} catch (ex: Exception) {
125-
val message = "There was an exception at ${now()} while executing Snapshot Management policy ${job.policyName}, please check logs."
126-
job.notificationConfig?.sendFailureNotification(client, job.policyName, message, job.user, log)
126+
@Suppress("InstanceOfCheckForException")
127+
if (ex !is VersionConflictEngineException) {
128+
val message = "There was an exception at ${now()} while executing Snapshot Management policy ${job.policyName}, please check logs."
129+
job.notificationConfig?.sendFailureNotification(client, job.policyName, message, job.user, log)
130+
}
131+
127132
@Suppress("InstanceOfCheckForException")
128133
if (ex is SnapshotManagementException &&
129134
ex.exKey == ExceptionKey.METADATA_INDEXING_FAILURE

0 commit comments

Comments
 (0)