Skip to content

Commit

Permalink
move deletion of query index before its creation (opensearch-project#…
Browse files Browse the repository at this point in the history
…1668)

Signed-off-by: Subhobrata Dey <[email protected]>
(cherry picked from commit ee91e3c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] authored and sbcd90 committed Sep 26, 2024
1 parent 1523922 commit 9d3b0e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ class DocumentLevelMonitorRunner : MonitorRunner() {
throw IndexNotFoundException(docLevelMonitorInput.indices.joinToString(","))
}

if (monitor.deleteQueryIndexInEveryRun == true &&
monitorCtx.docLevelMonitorQueries!!.docLevelQueryIndexExists(monitor.dataSources)
) {
val ack = monitorCtx.docLevelMonitorQueries!!.deleteDocLevelQueryIndex(monitor.dataSources)
if (!ack) {
logger.error(
"Deletion of concrete queryIndex:${monitor.dataSources.queryIndex} is not ack'd! " +
"for monitor ${monitor.id}"
)
}
}
monitorCtx.docLevelMonitorQueries!!.initDocLevelQueryIndex(monitor.dataSources)
monitorCtx.docLevelMonitorQueries!!.indexDocLevelQueries(
monitor = monitor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class DocLevelMonitorQueries(private val client: Client, private val clusterServ
}
bulkResponse.forEach { bulkItemResponse ->
if (bulkItemResponse.isFailed) {
log.debug(bulkItemResponse.failureMessage)
log.error(bulkItemResponse.failureMessage)
}
}
}
Expand Down

0 comments on commit 9d3b0e1

Please sign in to comment.