Skip to content
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

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

achouhan09
Copy link
Member

Explain the changes

  1. validate_replication() api call was made two times when we try to create obc, first independently and second with put_bucket_replication() api call. We updated the validate_replication() api code to work as expected.

Issues: Fixed #xxx / Gap #xxx

  1. Bidirectional validation check added in core not working as expected with operator code.

@@ -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) {
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@dannyzaken dannyzaken Nov 1, 2023

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?

Copy link
Member Author

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

Copy link
Member Author

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.

@achouhan09 achouhan09 marked this pull request as ready for review October 31, 2023 10:20
@achouhan09 achouhan09 force-pushed the bid-val branch 3 times, most recently from ff644de to a2a84e0 Compare November 8, 2023 13:36
Signed-off-by: Aayush Chouhan <aayush.chouhan97@gmail.com>
@achouhan09 achouhan09 merged commit 4de19cd into noobaa:master Nov 9, 2023
9 checks passed
@achouhan09 achouhan09 deleted the bid-val branch November 9, 2023 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants