From c2d6cbe1b1f4b7c26fa8da4eefa291b4bdb48835 Mon Sep 17 00:00:00 2001 From: Tianshan Qu Date: Mon, 29 Jul 2019 00:42:39 +0800 Subject: [PATCH] rgw: fix potential realm watch lost 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 --- src/rgw/rgw_realm_watcher.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_realm_watcher.cc b/src/rgw/rgw_realm_watcher.cc index 02e8b130e27..ee154f0f299 100644 --- a/src/rgw/rgw_realm_watcher.cc +++ b/src/rgw/rgw_realm_watcher.cc @@ -71,13 +71,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(const RGWRealm& realm) -- 2.39.5