Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in workflows for seg rep compatibility #1114

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.opensearch.alerting.script.ChainedAlertTriggerExecutionContext
import org.opensearch.alerting.util.AlertingException
import org.opensearch.alerting.util.isDocLevelMonitor
import org.opensearch.alerting.util.isQueryLevelMonitor
import org.opensearch.cluster.routing.Preference
import org.opensearch.common.xcontent.LoggingDeprecationHandler
import org.opensearch.common.xcontent.XContentHelper
import org.opensearch.common.xcontent.XContentType
Expand Down Expand Up @@ -226,11 +227,6 @@ object CompositeWorkflowRunner : WorkflowRunner() {
)
}
workflowRunResult.executionEndTime = Instant.now()

val sr = SearchRequest(dataSources!!.alertsIndex)
sr.source().query(QueryBuilders.matchAllQuery()).size(10)
val searchResponse: SearchResponse = monitorCtx.client!!.suspendUntil { monitorCtx.client!!.search(sr, it) }
searchResponse.hits
Comment on lines -230 to -233
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this dev code that was accidentally left over?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

return workflowRunResult
}

Expand Down Expand Up @@ -340,6 +336,7 @@ object CompositeWorkflowRunner : WorkflowRunner() {
try {
val searchRequest =
SearchRequest(getDelegateMonitorAlertIndex(dataSources, workflow, monitorCtx.alertIndices!!.isAlertHistoryEnabled()))
searchRequest.preference(Preference.PRIMARY_FIRST.type())
val queryBuilder = boolQuery()
queryBuilder.must(QueryBuilders.termQuery("execution_id", executionId))
queryBuilder.must(QueryBuilders.termQuery("state", getDelegateMonitorAlertState(workflow).name))
Expand Down
Loading