-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add allocation tests for searchable snapshot remote shards #5048
Add allocation tests for searchable snapshot remote shards #5048
Conversation
db495f5
to
1817e04
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
1817e04
to
2b26d2a
Compare
.setRenamePattern("(.+)") | ||
.setRenameReplacement("$1-copy") | ||
.setStorageType(RestoreSnapshotRequest.StorageType.REMOTE_SNAPSHOT) | ||
.setWaitForCompletion(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be inclined to not set "wait for completion" because you assert the relevant state below and it is usually best to avoid making tests wait on timeouts like this if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got rid of the synchronous timeout based call.
@@ -118,6 +125,206 @@ public void testCreateSearchableSnapshot() throws Exception { | |||
assertIndexDirectoryDoesNotExist("test-idx-1-copy", "test-idx-2-copy"); | |||
} | |||
|
|||
/** | |||
* Tests the functionality of {@link org.opensearch.cluster.routing.allocation.allocator.RemoteShardsBalancer} to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick but these types of documentation links tend to go stale with refactorings and it is probably not necessary to link to such low-level code in high-level integration tests like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added general statements instead of specific implementation details.
server/src/internalClusterTest/java/org/opensearch/snapshots/SearchableSnapshotIT.java
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
2b26d2a
to
e8857ea
Compare
Gradle Check (Jenkins) Run Completed with:
|
* nodes with search capabilities are added back to the cluster. | ||
*/ | ||
public void testSearchableSnapshotAllocationForFailoverAndRecovery() throws Exception { | ||
final int numReplicasIndex = randomIntBetween(1, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about taking the randomness away here and setting number of replicas to 1. Then you could run the following scenario:
- Ensure green after initial setup
- Stop one search node and ensure yellow
- Stop another search node and ensure red
- Add 3 new search nodes and ensure green
- Stop one search node and ensure green
Then I think you could get rid of the "testSearchableSnapshotAllocationWithNoSearchNodes" test case since that is covered here. It would also cover the "automatically recovery from red" scenario that currently isn't being tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This led to a discovery of an issue when the primary remote shards go unassigned. I'll add in the fix for it as well.
Thanks for the suggestion 🙂
e8857ea
to
cb8af5a
Compare
Gradle Check (Jenkins) Run Completed with:
|
cb8af5a
to
3741502
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
3741502
to
8f2a00f
Compare
This will cause a merge conflict due to #5055. Updating the PR. |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com>
8f2a00f
to
118cca1
Compare
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> (cherry picked from commit 082f059) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> (cherry picked from commit 082f059) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Kunal Kotwani kkotwani@amazon.com
Description
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.