Skip to content

Commit

Permalink
rgw: don't prevent overriding explicit placement changes in metadata set
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Feb 14, 2018
1 parent a829cd4 commit 0baebec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rgw/rgw_bucket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,11 @@ class RGWBucketInstanceMetadataHandler : public RGWMetadataHandler {
}
bci.info.index_type = rule_info.index_type;
} else {
/* existing bucket, keep its placement */
bci.info.bucket.explicit_placement = old_bci.info.bucket.explicit_placement;
bci.info.placement_rule = old_bci.info.placement_rule;
if (bci.info.bucket.explicit_placement.index_pool.empty()) {
/* existing bucket, keep its placement -- unless explicit placement is set */
bci.info.bucket.explicit_placement = old_bci.info.bucket.explicit_placement;
bci.info.placement_rule = old_bci.info.placement_rule;
}
}

if (exists && old_bci.info.datasync_flag_enabled() != bci.info.datasync_flag_enabled()) {
Expand Down

0 comments on commit 0baebec

Please sign in to comment.