Fix PrimaryAllocationIT Race Condition#37355
Merged
original-brownbear merged 4 commits intoelastic:masterfrom Jan 11, 2019
original-brownbear:37345
Merged
Fix PrimaryAllocationIT Race Condition#37355original-brownbear merged 4 commits intoelastic:masterfrom original-brownbear:37345
original-brownbear merged 4 commits intoelastic:masterfrom
original-brownbear:37345
Conversation
Contributor
original-brownbear
commented
Jan 11, 2019
- Forcing a stale primary allocation on a green index was tripping an assertion
- Added a test that this case still errors out correctly
- Made the ability to wipe stopped datanode's data public on the internal test cluster and used it to ensure correct behavior on the fixed test
- Previously it simply passed because the test finished before the index went green and would NPE when the index was green at the time of the shard store status request, that would then come up empty
- Closes CI: test failure PrimaryAllocationIT.testForceStaleReplicaToBePromotedToPrimaryOnWrongNode #37345
* Forcing a stale primary allocation on a green index was tripping the assertion that was removed * Added a test that this case still errors out correctly * Made the ability to wipe stopped datanode's data public on the internal test cluster and used it to ensure correct behaviour on the fixed test * Previously it simply passed because the test finished before the index went green and would NPE when the index was green at the time of the shard store status request, that would then come up empty * Closes #37345
Collaborator
|
Pinging @elastic/es-distributed |
DaveCTurner
reviewed
Jan 11, 2019
Member
DaveCTurner
left a comment
There was a problem hiding this comment.
Looks ok but I'm always cautious about changes to the InternalTestCluster API so I've asked for a second opinion.
|
|
||
| private void wipePendingDataDirectories() { | ||
| assert Thread.holdsLock(this); | ||
| public synchronized void wipePendingDataDirectories() { |
Member
There was a problem hiding this comment.
I can't see any obvious problems that arise from exposing this, but the API is kinda complicated so I'd like a second opinion from @ywelsch.
ywelsch
approved these changes
Jan 11, 2019
| ensureGreen(); | ||
| final String nodeWithoutData = randomFrom(dataNodes); | ||
| final int shardId = 0; | ||
| Throwable iae = expectThrows( |
Contributor
There was a problem hiding this comment.
IllegalArgumentException iae = ...
| createStaleReplicaScenario(master); | ||
| internalCluster().startDataOnlyNodes(2); | ||
| // Ensure the stopped primary's data is deleted so that it doesn't get picked up by the next datanode we start | ||
| internalCluster().wipePendingDataDirectories(); |
Contributor
There was a problem hiding this comment.
ok as a temporary solution. We definitely need a cleaner way of managing data paths in InternalTestCluster.
Contributor
Author
|
Jenkins run Gradle build tests 2 |
1 similar comment
Contributor
Author
|
Jenkins run Gradle build tests 2 |
Contributor
Author
|
Jenkins run Gradle build tests 1 |
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jan 12, 2019
…rsistence * elastic/master: Fix PrimaryAllocationIT Race Condition (elastic#37355) SQL: Make `FULL` non-reserved keyword in the grammar (elastic#37377) SQL: [Tests] Fix and enable internalClusterTests (elastic#37300) ML: Fix testMigrateConfigs (elastic#37373) Fix RollupDocumentation test to wait for job to stop
original-brownbear
added a commit
that referenced
this pull request
Jan 29, 2019
* Fix PrimaryAllocationIT Race Condition * Forcing a stale primary allocation on a green index was tripping the assertion that was removed * Added a test that this case still errors out correctly * Made the ability to wipe stopped datanode's data public on the internal test cluster and used it to ensure correct behaviour on the fixed test * Previously it simply passed because the test finished before the index went green and would NPE when the index was green at the time of the shard store status request, that would then come up empty * Closes #37345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.