diff options
Diffstat (limited to 'src/rgw/rgw_rados.cc')
-rw-r--r-- | src/rgw/rgw_rados.cc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 03cc1ebfdb3..05db9bff782 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -875,14 +875,6 @@ int RGWRados::init_complete() { 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); if (ret < 0) return ret; @@ -920,6 +912,14 @@ 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; for (ziter = region.zones.begin(); ziter != region.zones.end(); ++ziter) { const string& name = ziter->first; @@ -1109,6 +1109,8 @@ int RGWRados::init_watch() return r; } + watch_initialized = true; + return 0; } @@ -4903,6 +4905,14 @@ int RGWRados::append_async(rgw_obj& obj, size_t size, bufferlist& bl) int RGWRados::distribute(const string& key, bufferlist& bl) { + /* + * we were called before watch was initialized. This can only happen if we're updating some system + * config object (e.g., zone info) during init. Don't try to distribute the cache info for these + * objects, they're currently only read on startup anyway. + */ + if (!watch_initialized) + return 0; + string notify_oid; pick_control_oid(key, notify_oid); |