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

jewel: rgw: multisite: bucket zonegroup redirect not working #15448

Merged
merged 2 commits into from Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/rgw/rgw_op.cc
Expand Up @@ -369,6 +369,12 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
if (!r) {
if (!zonegroup.endpoints.empty()) {
s->zonegroup_endpoint = zonegroup.endpoints.front();
} else {
// use zonegroup's master zone endpoints

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smithfarm I believe It would be even better if we start comment with capital letter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitkumar50 Please check that the PR is targeting master before suggesting any changes.

auto z = zonegroup.zones.find(zonegroup.master_zone);
if (z != zonegroup.zones.end() && !z->second.endpoints.empty()) {
s->zonegroup_endpoint = z->second.endpoints.front();
}
}
s->zonegroup_name = zonegroup.get_name();
}
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest.cc
Expand Up @@ -717,7 +717,7 @@ void abort_early(struct req_state *s, RGWOp *op, int err_no,
if (!s->redirect.empty()) {
dest_uri = s->redirect;
} else if (!s->zonegroup_endpoint.empty()) {
string dest_uri = s->zonegroup_endpoint;
dest_uri = s->zonegroup_endpoint;
/*
* reqest_uri is always start with slash, so we need to remove
* the unnecessary slash at the end of dest_uri.
Expand Down