-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix to handle the exception for deletion of non-existing autofollow replication rule #1371
Conversation
Signed-off-by: Sanjay Kumar <[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.
curl -Method DELETE -Uri "http://localhost:9201/_plugins/_replication/_autofollow?pretty" -H @{'Content-T
ype' = 'application/json'} -body '{"leader_alias":"leader", "name": "dummy"}'
StatusCode : 200
StatusDescription : OK
Content : {
"acknowledged" : true
}
- From description
Can you confirm if you are getting 200 and not ResourceNotFoundException ?
Hi @monusingh-1 , Yes, the current behaviour as of now is as below:
But if there is any replication rule already there : a) Create a replication rule "leader:test1"
b) Delete a non existing rule (say "leader:test2"), then the deletion of that replication rule returns 200.
|
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 for the fix! LGTM.
…le (#1371) Signed-off-by: Sanjay Kumar <[email protected]> (cherry picked from commit d404742)
…le (#1371) (#1372) Signed-off-by: Sanjay Kumar <[email protected]> (cherry picked from commit d404742) Co-authored-by: Sanjay Kumar <[email protected]>
…le (opensearch-project#1371) (opensearch-project#1372) Signed-off-by: Sanjay Kumar <[email protected]> (cherry picked from commit d404742) Co-authored-by: Sanjay Kumar <[email protected]>
Description
This PR handles the exception for deletion of any non-existing replication rule.
Earlier behaviour:
If any replication rule is tried to be deleted before creation of the first replication rule, it throws ResourceNotFoundException.
ex:
Directly delete the autofollow replication rule before creation of any autofollow rule.
Now, create a new replication rule 'A' and try to delete replication rule 'B'. Here we could see that there is a successful response in deleting a non-existing replication rule.
Behaviour now:
Deletion of any non existing replication rule.
Issues Resolved
#1370
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.