mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
rgw: fix crash when creating new zone on init
Moving the watch/notify init before the zone init, as we might need to send a notification. Reviewed-by: Sage Weil <sage@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
617dc36d47
commit
3d55534268
@ -875,6 +875,14 @@ int RGWRados::init_complete()
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (need_watch_notify()) {
|
||||||
|
ret = init_watch();
|
||||||
|
if (ret < 0) {
|
||||||
|
lderr(cct) << "ERROR: failed to initialize watch" << dendl;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = region.init(cct, this);
|
ret = region.init(cct, this);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@ -912,14 +920,6 @@ int RGWRados::init_complete()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_watch_notify()) {
|
|
||||||
ret = init_watch();
|
|
||||||
if (ret < 0) {
|
|
||||||
lderr(cct) << "ERROR: failed to initialize watch" << dendl;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
map<string, RGWZone>::iterator ziter;
|
map<string, RGWZone>::iterator ziter;
|
||||||
for (ziter = region.zones.begin(); ziter != region.zones.end(); ++ziter) {
|
for (ziter = region.zones.begin(); ziter != region.zones.end(); ++ziter) {
|
||||||
const string& name = ziter->first;
|
const string& name = ziter->first;
|
||||||
|
Loading…
Reference in New Issue
Block a user