-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Reporting regression: reports always retrying regardless of outcome #26995
Reporting regression: reports always retrying regardless of outcome #26995
Conversation
@@ -353,6 +353,7 @@ export class Worker extends events.EventEmitter { | |||
constant_score: { | |||
filter: { | |||
bool: { | |||
minimum_should_match: 1, |
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 want a query that's equivalent of
jobtype == this.jobtype &&
(status == "pending" ||
(status == "processing" && process_expiration <= nowTime))
I'd recommend trying to do this without using constant_score
. Can we try:
{
query: {
bool: {
filter: {
bool: {
must: { term: { jobtype: this.jobtype } },
should: [
{ term: { status: 'pending' } },
{
bool: {
must: [
{ term: { status: 'processing' } },
{ range: { process_expiration: { lte: nowTime } } }
]
}
}
]
}
}
}
}
}
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.
Dope! I still needed the minimum_should_match: 1
in order for this to work, just an FYI
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.
With further digging, I find that adding minimum_should_match: 1
was perhaps the only change needed.
💔 Build Failed |
💚 Build Succeeded |
I believe after this PR goes in, we can revert the changes to reporting tests in #26877 |
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.
LGTM
I got word that the change in ES around this was elastic/elasticsearch#35354 |
6.x/6.6.0: #27082 |
Summary
I've been experiencing a recent regression, where, reports are continuously retrying regardless of status. Upon further investigation it appears that our queries for outstanding jobs were returning jobs of all statuses. This PR fixes the underlying issue (which appears to be that
should
doesn't necessarily need to match in order to return). I'm not sure why this wasn't an issue prior, perhaps a bugfix that landed in ES or its deps.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibility