Skip to content
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

TESTS: Relax Assertion About Deleting Shard Dir #34120

Merged
merged 3 commits into from
Sep 28, 2018

Conversation

original-brownbear
Copy link
Member

* Allow empty state directory to prevent test from failing
* Closes elastic#32686
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. v7.0.0 v6.5.0 labels Sep 27, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I've left one small suggestion, looks good otherwise. I think this should also go into the 6.4 branch as we are still actively running CI there.

Set<Path> existingPaths = new HashSet<>();
for (Path path : paths) {
if (FileSystemUtils.exists(path)) {
existingPaths.add(path);
}
}
// Relaxed assertion for the special case where only the empty state directory exists after deleting
// the shard directory because it was created again as a result of a metadata read action concurrently.
if (existingPaths.size() == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it's easier to move the "check if there's only a left-over MetaDataStateFormat.STATE_DIR_NAME" logic into the if (FileSystemUtils.exists(path)) { condition above. Then you won't have to remove stuff again from existingPaths.

Copy link
Member Author

Choose a reason for hiding this comment

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

yea that would save a few lines :) sec adjusting

@jasontedor
Copy link
Member

I think this should also go into the 6.4 branch as we are still actively running CI there.

And 5.6.

@original-brownbear
Copy link
Member Author

@ywelsch applied your suggestion, much nicer this way I think ... with the initial version we would've also lost the logging of the name of the leftover paths.

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

@original-brownbear
Copy link
Member Author

@ywelsch thanks!

@original-brownbear original-brownbear merged commit 76dd394 into elastic:master Sep 28, 2018
@original-brownbear original-brownbear deleted the 32686 branch September 28, 2018 17:11
DaveCTurner pushed a commit that referenced this pull request Oct 3, 2018
* TESTS: Relax Assertion About Deleting Shard Dir

* Allow empty state directory to prevent test from failing
* Closes #32686
DaveCTurner pushed a commit that referenced this pull request Oct 3, 2018
* TESTS: Relax Assertion About Deleting Shard Dir

* Allow empty state directory to prevent test from failing
* Closes #32686
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Oct 3, 2018
* TESTS: Relax Assertion About Deleting Shard Dir
* Allow empty state directory to prevent test from failing
* Closes elastic#32686

Backport of elastic#34120 and some associated changes.

Co-authored-by: Armin Braun <[email protected]>
@DaveCTurner
Copy link
Contributor

Backport to 5.6 wasn't totally trivial so I opened #34266.

DaveCTurner added a commit that referenced this pull request Oct 4, 2018
* TESTS: Relax Assertion About Deleting Shard Dir
* Allow empty state directory to prevent test from failing
* Closes #32686

Backport of #34120 and some associated changes.

Co-authored-by: Armin Braun <[email protected]>
kcm pushed a commit that referenced this pull request Oct 30, 2018
* TESTS: Relax Assertion About Deleting Shard Dir

* Allow empty state directory to prevent test from failing
* Closes #32686
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Dec 4, 2018
* Retry loading latest state to deal with concurrent deletes of the state file
* Relates elastic#34120 that ran into similar concurrency issues with the state files
* Closes elastic#36189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. >test Issues or PRs that are addressing/adding tests v6.4.2 v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants