-
Notifications
You must be signed in to change notification settings - Fork 69
Indices deletion in leader cluster do not get replicated in follower cluster #1556
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
base: main
Are you sure you want to change the base?
Indices deletion in leader cluster do not get replicated in follower cluster #1556
Conversation
…cluster Introduced a new setting parameter 'plugins.replication.replicate.delete_index'. If this propert's value is set to true, it will replicate the deletion of leader indecx to follower, othwise it will just pause the replication. Resolves opensearch-project#1434 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt
Outdated
Show resolved
Hide resolved
…cluster Introduced a new setting parameter 'plugins.replication.replicate.delete_index'. If this propert's value is set to true, it will replicate the deletion of leader indecx to follower, othwise it will just pause the replication. Resolves opensearch-project#1434 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
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.
The flow of deletion is not very clear. Let's also document that in PR description for context.
src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
Added the deletion flow details in the PR description |
@ankitkala and other maintainers, Gentle Reminder for review! |
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.
Changes looks good to me. Have few minor comments
src/test/kotlin/org/opensearch/replication/integ/rest/StopReplicationIT.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt
Outdated
Show resolved
Hide resolved
… ReplicationSettings.k Added a new test case with by setting plugins.replication.replicate.delete_index as false Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
Looks good to me. |
It shows error message as "index_not_found_exception","reason":"no such index [index-id]" {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [follower-21]","index":"follower-21","resource.id":"follower-21","resource.type":"index_or_alias","index_uuid":"na"}],"type":"index_not_found_exception","reason":"no such index [follower-21]","index":"follower-21","resource.id":"follower-21","resource.type":"index_or_alias","index_uuid":"na"},"status":404} |
What about the metadata in
|
Output before deletion of leader index: Output after deletion of leader index: |
Description
Introduced a new setting parameter 'plugins.replication.replicate.delete_index'. If this property's value is set to true, it will replicate the deletion of leader index to follower. That means, the corresponding follower index will get deleted automatically. The default behavior is just pause the replication(existing behavior).
The property 'plugins.replication.replicate.delete_index' is follower level. It has to set to each follower to delete index from that follower.
Flow of deletion - Whenever replication state comes to FailedState, first check whether delete_index replication is enabled in the setting and failure reason is "IndexNotFoundException of leader index" then it will trigger the stop of replication. Then in the cleanup() activity of IndexReplicationTask check whether replication is state is COMPLETED and corresponding leader index is deleted, then trigger the deletion of the follower index.
If delete_index replication is not enabled or failure reason is not "IndexNotFoundException of leader index" then it will just pause the replication.
Automated Testing:
test auto pause of index replication when leader index is unavailable
Manual Testing:
Related Issues
Resolves #1434
Check List
--signoff
.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.