Skip to content

Commit

Permalink
fix: move refresh just before the match_all query
Browse files Browse the repository at this point in the history
Using the command line provided in elastic#81983 I could not reproduce the issue.
Anyway, changing the timeout from 5 seconds to just 1 second I could
reproduce the issue. At the end, keeping a timeout of 1 second I could fix
the issue moving the refresh operation just before running the match_all
query. My understanding is that the timeout is used to give the rollup job
enough time to complete the rollup operation. Anyway, other than that, after
the rollup job has written data into the rollup index we need to refresh it
in order for the subsequent search operation to hit the expected rolledup
document.
  • Loading branch information
salvatore-campagna committed May 20, 2022
1 parent 8c2f429 commit 7968c70
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ teardown:
id: foo
- is_true: started

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
indices.refresh:
index: rollup

# this is a hacky way to sleep for 5s, since we will never have 10 nodes
- do:
catch: request_timeout
Expand All @@ -140,6 +135,11 @@ teardown:
- match:
jobs.0.stats.documents_processed: 1

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
indices.refresh:
index: rollup

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
search:
Expand Down Expand Up @@ -279,11 +279,6 @@ teardown:
id: foo
- is_true: started

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
indices.refresh:
index: rollup

# this is a hacky way to sleep for 5s, since we will never have 10 nodes
- do:
catch: request_timeout
Expand All @@ -300,6 +295,11 @@ teardown:
- match:
jobs.0.stats.documents_processed: 1

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
indices.refresh:
index: rollup

- do:
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
search:
Expand Down

0 comments on commit 7968c70

Please sign in to comment.