Skip to content

Make testSortAndPaginateWithInProgress test stable#80530

Merged
arteam merged 11 commits intoelastic:masterfrom
arteam:fix-test-sort-paginate-with-in-progress
Jan 18, 2022
Merged

Make testSortAndPaginateWithInProgress test stable#80530
arteam merged 11 commits intoelastic:masterfrom
arteam:fix-test-sort-paginate-with-in-progress

Conversation

@arteam
Copy link
Copy Markdown
Contributor

@arteam arteam commented Nov 9, 2021

Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

Fixes #79779
Relates #78507

Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

Fixes elastic#79779
Relates elastic#78507
@arteam arteam added the :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs label Nov 9, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team. label Nov 9, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@arteam arteam added v7.16.1 auto-backport Automatically create backport pull requests when merged >test Issues or PRs that are addressing/adding tests and removed Team:Distributed Meta label for distributed team. labels Nov 9, 2021
@original-brownbear original-brownbear self-requested a review November 9, 2021 13:05
@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Nov 11, 2021

@elasticmachine update branch

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Nov 25, 2021

@elasticmachine update branch

@arteam arteam closed this Nov 25, 2021
@arteam arteam reopened this Nov 25, 2021
@arteam arteam requested review from henningandersen and original-brownbear and removed request for original-brownbear November 29, 2021 09:02
Copy link
Copy Markdown
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

Left a couple of comments to ensure I understand the change correctly.

Comment on lines +51 to +52
.put("thread_pool.snapshot.core", 5)
.put("thread_pool.snapshot.max", 5)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment on why this need to be raised?

Also, I think 2 would be enough, 1 to be blocked for test-index-2 and one to ensure test-index-1 completes?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you missed this comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I indeed missed it! I've moved LARGE_SNAPSHOT_POOL_SETTINGS to RestGetSnapshotsIT. I believe 2 is insufficient, the test hangs with 2 threads, but works with 3.

Copy link
Copy Markdown
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

I don't think this is enough unfortunately, see inline comment.

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Dec 15, 2021

@elasticmachine update branch

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Jan 5, 2022

@elasticmachine update branch

@arteam arteam requested a review from henningandersen January 6, 2022 20:51
@bpintea bpintea added v7.16.4 and removed v7.16.3 labels Jan 10, 2022
Copy link
Copy Markdown
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

I think the CS wait check can be simplified some more, other than that looks alright.

e -> e.getKey().getIndexName().equals("test-index-1") == false
|| e.getValue().state() == SnapshotsInProgress.ShardState.SUCCESS
);
boolean secondIndexIsBlocked = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We shouldn't need this second check. If we make sure that all snapshots for index-1 are successful, then that should be the end state of things. The state of snapshots for the second index should be initialized to exactly what we're asserting here right away I think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#80530 (comment)

@original-brownbear That was the original implementation (with only the test-index-1 check) and you suggested to add an addition check for the second index 😃

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong feeling towards this one way or another (the test passes on 100 iterations both with secondIndexIsBlocked check and without it).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, now I remember :) Sorry about that.

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Jan 13, 2022

@elasticmachine update branch

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Jan 13, 2022

@elasticmachine run elasticsearch-ci/eql-correctness

@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Jan 18, 2022

@elasticmachine update

Copy link
Copy Markdown
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for the delay here

e -> e.getKey().getIndexName().equals("test-index-1") == false
|| e.getValue().state() == SnapshotsInProgress.ShardState.SUCCESS
);
boolean secondIndexIsBlocked = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, now I remember :) Sorry about that.

@arteam arteam merged commit b5d83a5 into elastic:master Jan 18, 2022
@arteam
Copy link
Copy Markdown
Contributor Author

arteam commented Jan 18, 2022

Thanks @original-brownbear!

arteam added a commit to arteam/elasticsearch that referenced this pull request Jan 18, 2022
Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

* Move LARGE_SNAPSHOT_SETTINGS to AbstractSnapshotRestTestCase to be reused
* Check that test-index-2 is blocked
* Be more clear that the 2nd index is blocked

Fixes elastic#79779
Relates elastic#78507
arteam added a commit to arteam/elasticsearch that referenced this pull request Jan 18, 2022
Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

* Move LARGE_SNAPSHOT_SETTINGS to AbstractSnapshotRestTestCase to be reused
* Check that test-index-2 is blocked
* Be more clear that the 2nd index is blocked

Fixes elastic#79779
Relates elastic#78507
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
8.0
7.17

@arteam arteam deleted the fix-test-sort-paginate-with-in-progress branch January 18, 2022 18:23
arteam added a commit that referenced this pull request Jan 18, 2022
Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

* Move LARGE_SNAPSHOT_SETTINGS to AbstractSnapshotRestTestCase to be reused
* Check that test-index-2 is blocked
* Be more clear that the 2nd index is blocked

Fixes #79779
Relates #78507
arteam added a commit that referenced this pull request Jan 19, 2022
…82759)

Start asserting snapshots in progress only in case when they reach
a stable state (the first index has finished, the second has been
blocked).

* Move LARGE_SNAPSHOT_SETTINGS to AbstractSnapshotRestTestCase to be reused
* Check that test-index-2 is blocked
* Be more clear that the 2nd index is blocked

Fixes #79779
Relates #78507
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >test Issues or PRs that are addressing/adding tests v7.17.0 v8.0.0-rc2 v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] RestGetSnapshotsIT testSortAndPaginateWithInProgress failing

9 participants