-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Added CCR rolling upgrade tests #36648
Added CCR rolling upgrade tests #36648
Conversation
Pinging @elastic/es-distributed |
This test is currently marked as WIP as it depends on a bug fix: #36647 and
I'm not yet sure how this can happen, because the serialization logic in |
I've also noticed this serialization error in bulk shards operations api:
|
@martijnvg I have merged #36676 which should fix the translog serialization issue. |
run the gradle build tests 1 |
run the gradle build tests 2 |
@dnhatn I've update this PR. Do you want to take another look? |
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.
Thanks @martijnvg. I like these tests - they are easy to follow. I left some minor comments.
|
||
private static void putAutoFollowPattern(String patternName) throws IOException { | ||
Request request = new Request("PUT", "/_ccr/auto_follow/" + patternName); | ||
request.setJsonEntity("{\"leader_index_patterns\": [\"logs-*\"], \"remote_cluster\": \"local\"," + |
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.
It's easier to follow if we pass the pattern (that's logs-*
) as a parameter.
} | ||
|
||
private void assertFollowerGlobalCheckpoint(String followerIndex, int expectedFollowerCheckpoint) throws IOException { | ||
Request statsRequest = new Request("GET", "/" + followerIndex + "/_ccr/stats"); |
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 think a seq_no stats of the following index would give us a stronger confidence than the ccr stats.
} | ||
} | ||
|
||
private void assertNumberOfSuccessfulFollowedIndices(int expectedNumberOfSuccessfulFollowedIndices) throws IOException { |
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.
Maybe remove this method and assert the result of "getNumberOfSuccessfulFollowedIndices"?
|
||
pauseFollow("copy-" + leaderIndex2); | ||
closeIndex("copy-" + leaderIndex2); | ||
unfollow("copy-" + leaderIndex2); |
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.
Maybe do all pause, close and unfollow in a single method?
case MIXED: | ||
if (SECOND_ROUND == false) { | ||
index(leaderIndex, "2"); | ||
assertDocumentExists(leaderIndex, "2"); |
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.
Maybe assert the existence of both doc1 and doc2? You can extend assertDocumentExists
to accept varargs.
@dnhatn I've updated the PR. |
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.
LGTM. Thanks @martijnvg. I left minor nits but feel free to merge once CI is happy.
assertDocumentExists(leaderIndex, "4"); | ||
assertBusy(() -> { | ||
assertFollowerGlobalCheckpoint(followerIndex, 3); | ||
assertDocumentExists(followerIndex, "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.
nit: can we also verify doc1, doc2, and doc3?
assertDocumentExists(leaderIndex, "3"); | ||
assertBusy(() -> { | ||
assertFollowerGlobalCheckpoint(followerIndex, 2); | ||
assertDocumentExists(followerIndex, "3"); |
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.
nit: can we also verify doc1, and doc2
I will backport this later to 6.x, if I didn't encounter build failures related to this change. |
Added CCR rolling upgrade tests.
These tests were added via #36648
Tests index following and auto following in a rolling upgrade scenario.
Test are written as Java tests using low level client instead of yaml tests, because CCR needs assertBusy(...) snippets to be tested correctly and that is not possible in yaml tests.