]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix potential realm watch lost 30167/head
authorTianshan Qu <tianshan@xsky.com>
Sun, 28 Jul 2019 16:42:39 +0000 (00:42 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 5 Sep 2019 08:13:59 +0000 (10:13 +0200)
realm watch only restart on -ENOTCONN, but if we fail to maintain the watch ping, the OSD will return -ETIMEDOUT.
The objecter will keep the watch err on last_error, if last_error not empty, it will not call handle_error in future error,
so it will never get the chance to rewatch on following -ENOTCONN error.

Fixes: http://tracker.ceph.com/issues/40991
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit c2d6cbe1b1f4b7c26fa8da4eefa291b4bdb48835)

src/rgw/rgw_realm_watcher.cc

index 7389c3f80b95fcd4670c9a7c63e13f1b35d216a8..32e25f7823998e0cd27034be98ba1f1c47e286b8 100644 (file)
@@ -70,13 +70,11 @@ void RGWRealmWatcher::handle_notify(uint64_t notify_id, uint64_t cookie,
 
 void RGWRealmWatcher::handle_error(uint64_t cookie, int err)
 {
+  lderr(cct) << "RGWRealmWatcher::handle_error oid=" << watch_oid << " err=" << err << dendl;
   if (cookie != watch_handle)
     return;
 
-  if (err == -ENOTCONN) {
-    ldout(cct, 4) << "Disconnected watch on " << watch_oid << dendl;
-    watch_restart();
-  }
+  watch_restart();
 }
 
 int RGWRealmWatcher::watch_start(RGWRealm& realm)