-
Notifications
You must be signed in to change notification settings - Fork 103
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
optimize execution of workflow consisting of bucket-level followed by doc-level monitors #1729
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bc90d8f
optimize execution of workflow consisting of bucket-level followed by…
sbcd90 14f9371
sort matching docs by seq_no
sbcd90 3495cf8
update code-review comments
sbcd90 f6a6375
address comments
sbcd90 036f01c
Upgrade to upload-artifact v4 (#1739)
cwperks 605105b
fix ktlint
sbcd90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,8 @@ class DocumentLevelMonitorRunner : MonitorRunner() { | |
} | ||
|
||
// Map of document ids per index when monitor is workflow delegate and has chained findings | ||
val matchingDocIdsPerIndex = workflowRunContext?.matchingDocIdsPerIndex | ||
val matchingDocIdsPerIndex = workflowRunContext?.matchingDocIdsPerIndex?.first | ||
val findingIdsForMatchingDocIds = workflowRunContext?.matchingDocIdsPerIndex?.second | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will this map each individual doc id to finding id There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will still have one part |
||
|
||
val concreteIndicesSeenSoFar = mutableListOf<String>() | ||
val updatedIndexNames = mutableListOf<String>() | ||
|
@@ -226,6 +227,7 @@ class DocumentLevelMonitorRunner : MonitorRunner() { | |
concreteIndices, | ||
conflictingFields.toList(), | ||
matchingDocIdsPerIndex?.get(concreteIndexName), | ||
findingIdsForMatchingDocIds | ||
) | ||
|
||
val shards = mutableSetOf<String>() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we sorting based on _seq_no?
there is already a range query based on
period_end
variablethis seems incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to sort this because without
sort
, we getrandom 10 docs in period of last 15 minutes
by default for a workflow runningevery 1 min
. Now, the aggregation may have grouped1000 docs
.So,
10 out of 1000 docs generated
may not be the latest ones. We pass these10 docs
to the delegateddoc-level monitor
which has already moved itsseq_no
past these10 random docs
and hence do not generate an alert.sort by seq_no
ensures we always get thelatest 10 docs out of the 1000 docs
considered for aggregation. Thus, when the doc-level monitor runs next time, it getslatest 10 docs
and it goes on to geenrate an alert.