Skip to content

Reporting regression: reports always retrying regardless of outcome#26995

Merged
joelgriffith merged 5 commits intoelastic:masterfrom
joelgriffith:reporting/bugfix-reports-always-retrying
Dec 12, 2018
Merged

Reporting regression: reports always retrying regardless of outcome#26995
joelgriffith merged 5 commits intoelastic:masterfrom
joelgriffith:reporting/bugfix-reports-always-retrying

Conversation

@joelgriffith
Copy link
Contributor

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 strikethroughs to remove checklist items you don't feel are applicable to this PR.

Copy link
Member

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 } } }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

Copy link
Contributor Author

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

Copy link
Member

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.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joelgriffith joelgriffith added review zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead v6.0.0 v6.6.0 and removed v6.0.0 labels Dec 12, 2018
@tsullivan
Copy link
Member

I believe after this PR goes in, we can revert the changes to reporting tests in #26877

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

@joelgriffith joelgriffith merged commit 93e3a4c into elastic:master Dec 12, 2018
@tsullivan
Copy link
Member

I got word that the change in ES around this was elastic/elasticsearch#35354

joelgriffith added a commit that referenced this pull request Dec 12, 2018
…26995) (#27082)

* This fixes an issue where reports are always retried regardless of status
@tsullivan
Copy link
Member

6.x/6.6.0: #27082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported review v6.6.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants