-
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
Added a check for bidirectional replication for matching prefix #7524
Conversation
const replication_rules = req.rpc_params.replication_policy.rules; | ||
// num of rules in configuration must be in defined limits | ||
if (replication_rules.length > config.BUCKET_REPLICATION_MAX_RULES || | ||
replication_rules.length < 1) throw new RpcError('INVALID_REPLICATION_POLICY', 'Number of rules is invalid'); | ||
|
||
const rule_ids = []; | ||
const pref_by_dst_bucket = {}; | ||
const src_bucket = req.system.buckets_by_name && req.system.buckets_by_name[req.name]; |
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.
why not get it from the rule in this request?
At this point we do not care about the bucket, only about it's name
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.
Here, as in rules bucket id
is stored in the DB so we need the bucket id instead of name to compare.
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.
Some comments + please add some tests
a07a84d
to
9d63c0e
Compare
7491ae6
to
c0bf229
Compare
…g prefixes 2. Added tests for bidirectional replication validation Signed-off-by: Aayush Chouhan <aayush.chouhan97@gmail.com>
Explain the changes