-
Notifications
You must be signed in to change notification settings - Fork 76
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 - bidirectional validation flow should work with operator flow #7555
Conversation
@@ -1933,7 +1932,7 @@ function validate_replication(req, db_repl_rules) { | |||
} | |||
|
|||
// validation for bidirectional replication - blocking bidirectional replication only for matching prefixes | |||
if (destination_bucket.unwrap() !== req.rpc_params.name.unwrap()) { | |||
if (destination_bucket.unwrap() !== req.rpc_params.name.unwrap() && src_bucket) { |
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.
@dannyzaken @liranmauda This condition here is specific to obc, as for obc validate_replication()
is called two times one before the creation of src_bucket and one after the src_bucket creation inside put_bucket_replication()
. Because of this condition check only execute if src_bucket is already present/created.
Thats the best way I found here for this fix, pls feel free to provide more suggestions.
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.
@achouhan09 I suggest adding the above text as a comment in the code.
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.
@achouhan09, I'm not sure I understand. even if the source bucket is not created yet, don't we still want to check the replication_rules against destinations?
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.
Actually, here if src_bucket is not present then we cannot fetch the src_bucket._id
which was stored in DB replication_rules, as this time src_bucket would be the destination_bucket in this validation check.
Let me know if you need more explaination
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.
@liranmauda comment has beed added as per your suggestion, PTAL.
ff644de
to
a2a84e0
Compare
Signed-off-by: Aayush Chouhan <aayush.chouhan97@gmail.com>
Explain the changes
validate_replication()
api call was made two times when we try to create obc, first independently and second withput_bucket_replication()
api call. We updated thevalidate_replication()
api code to work as expected.Issues: Fixed #xxx / Gap #xxx