From 051a94ac9d27afbca20a823496e9d0bce6902ee6 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 14:24:23 -0700 Subject: [PATCH] revert to deleting monitor metadata after deleting doc level queries to fix regression. Metadata is required for correct query index clean up (#931) (#936) Signed-off-by: Surya Sashank Nistala (cherry picked from commit 5e2312d7a6afdf35dc39534723df1947592e01ec) Co-authored-by: Surya Sashank Nistala --- .../alerting/transport/TransportDeleteMonitorAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt index e5f71133d..885986ee3 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt @@ -155,8 +155,8 @@ class TransportDeleteMonitorAction @Inject constructor( monitorId: String, ): DeleteResponse { val deleteResponse = deleteMonitorDocument(client, deleteRequest) - deleteMetadata(client, monitor) deleteDocLevelMonitorQueriesAndIndices(client, monitor, monitorId) + deleteMetadata(client, monitor) return deleteResponse }