-
Notifications
You must be signed in to change notification settings - Fork 61
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
stopping replication before clean up of indices #619
stopping replication before clean up of indices #619
Conversation
Codecov Report
@@ Coverage Diff @@
## main #619 +/- ##
============================================
+ Coverage 70.76% 73.10% +2.34%
- Complexity 966 983 +17
============================================
Files 141 141
Lines 4600 4600
Branches 507 507
============================================
+ Hits 3255 3363 +108
+ Misses 1013 923 -90
+ Partials 332 314 -18
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -421,6 +422,13 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |||
} | |||
|
|||
protected fun wipeIndicesFromCluster(testCluster: TestCluster) { | |||
|
|||
val followerStatsMap: Map<String,Any> = OpenSearchRestTestCase.entityAsMap(testCluster.lowLevelClient.performRequest(Request("GET","/_plugins/_replication/follower_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.
@saikaranam-amazon Just a thought, should we also handle the exception cases(if stop called failed) here maybe?
e.g.
- Ensure that all replication related tasks are cancelled.
- Cleaning up replication metadata as well, 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.
yes, we can target for replication tasks but
any failure to remove the blocks are still applicable in this case (as we currently, we don't have clean way to do that) and with metadata present, we might attempt to clean the state eventually.
Probably, we should prioritise the issue to cleanly exit _stop replication API call. Thoughts?
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.
Makes sense. In that case, at least we need to randomize the leader and follower index names in all tests to avoid any cascading failures incase we aren't able to do a clean _stop
. Probably we can fast follow after this PR.
@@ -421,6 +422,13 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |||
} | |||
|
|||
protected fun wipeIndicesFromCluster(testCluster: TestCluster) { | |||
|
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.
From Follower stats API response, do we need to filter any indices? I mean just wanted to confirm that we are iterating over syncing/bootstrapping/failed indices but not stopped ones.
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.
follower indices whose status is REPLICATION NOT IN PROGRESS
are giving 200 OK
response when passed to stopReplication API, If those indices are skipped then DELETE request is failing
@@ -160,4 +160,26 @@ class BasicReplicationIT : MultiClusterRestTestCase() { | |||
followerClient.stopReplication(followerIndexName) | |||
} | |||
} | |||
|
|||
fun `test existing index replication and not stopping replication`() { |
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.
Can we remove the _stop
API calls from the previous tests?
I think, that should be sufficient.
@@ -421,6 +422,13 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |||
} | |||
|
|||
protected fun wipeIndicesFromCluster(testCluster: TestCluster) { | |||
|
|||
val followerStatsMap: Map<String,Any> = OpenSearchRestTestCase.entityAsMap(testCluster.lowLevelClient.performRequest(Request("GET","/_plugins/_replication/follower_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.
yes, we can target for replication tasks but
any failure to remove the blocks are still applicable in this case (as we currently, we don't have clean way to do that) and with metadata present, we might attempt to clean the state eventually.
Probably, we should prioritise the issue to cleanly exit _stop replication API call. Thoughts?
"blocked by: [FORBIDDEN/1000/index read-only(cross-cluster-replication)];]") | ||
|
||
} finally { | ||
follower.stopReplication(followerIndex) |
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.
Lets remove the calls from other integration tests as well - StopIT, StartIT etc?
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.
ok
Can you fix the DCO check? |
…ionJobs API added in MultiClusterRestTestCase Signed-off-by: sricharanvuppu <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-619-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.1 1.1
# Navigate to the new working tree
cd .worktrees/backport-1.1
# Create a new branch
git switch --create backport/backport-619-to-1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-1.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.1 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.0 2.0
# Navigate to the new working tree
cd .worktrees/backport-2.0
# Create a new branch
git switch --create backport/backport-619-to-2.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.0 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-619-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-619-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-619-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.3 2.3
# Navigate to the new working tree
cd .worktrees/backport-2.3
# Create a new branch
git switch --create backport/backport-619-to-2.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.3 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.4 2.4
# Navigate to the new working tree
cd .worktrees/backport-2.4
# Create a new branch
git switch --create backport/backport-619-to-2.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.4 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.1 2.1
# Navigate to the new working tree
cd .worktrees/backport-2.1
# Create a new branch
git switch --create backport/backport-619-to-2.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.1 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.2 2.2
# Navigate to the new working tree
cd .worktrees/backport-2.2
# Create a new branch
git switch --create backport/backport-619-to-2.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ad8e8ded88c2548a6811855929d5c71f5cea4e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-619-to-2.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.2 Then, create a pull request where the |
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) (#638) Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ionJobs API added in MultiClusterRestTestCase (#619) (#639) Signed-off-by: sricharanvuppu <[email protected]>
…ionJobs API added in MultiClusterRestTestCase (#619) (#640) Signed-off-by: sricharanvuppu <[email protected]>
…ionJobs API added in MultiClusterRestTestCase (#619) (#641) Signed-off-by: sricharanvuppu <[email protected]>
…ionJobs API added in MultiClusterRestTestCase (#619) (#642) Signed-off-by: sricharanvuppu <[email protected]>
…ses and stopAllReplicationJobs API added in MultiClusterRestTestCase (#643) Signed-off-by: sricharanvuppu <[email protected]>
…ionJobs API added in MultiClusterRestTestCase (#619) (#644) Signed-off-by: sricharanvuppu <[email protected]>
…ionJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]> Signed-off-by: sricharanvuppu <[email protected]> (cherry picked from commit ad8e8de)
…ses (#694) * stopReplication API removed from integ test cases and stopAllReplicationJobs API added in MultiClusterRestTestCase (#619) Signed-off-by: sricharanvuppu <[email protected]>
…ses (#693) * stopReplication API removed from integ testcases and stopAllReplicationJobs API added in MultiClusterRestTestCase cherry-picked commit ad8e8de Signed-off-by: sricharanvuppu <[email protected]>
Signed-off-by: sricharanvuppu [email protected]
Description
stopping replication before clean up of indices
Issues Resolved
#412
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.