]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: shouldn't call index_op.cancel() when rados op return ETIMEDOUT 61093/head
authorlu.shasha <lu.shasha@aishu.cn>
Fri, 6 Dec 2024 04:40:27 +0000 (12:40 +0800)
committerlu.shasha <lu.shasha@aishu.cn>
Thu, 19 Dec 2024 08:06:39 +0000 (16:06 +0800)
when rados op return ETIMEOUT, rgw can't determine whether or not the rados op succeeded,
we shouldn't be calling index_op->cancel() in this case
Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes()

Signed-off-by: Shasha Lu <lu.shasha@aishu.cn>
(cherry picked from commit 0c578a127e30a372da33ea52df3b1c2654178020)

Conflicts:
src/rgw/driver/rados/rgw_rados.cc

src/rgw/driver/rados/rgw_rados.cc

index 566b7d6c2f9f0a89ea774779d7182b5d0ecb573f..75c590d6ae376acbd5f21628c26d4f642999947e 100644 (file)
@@ -3262,12 +3262,17 @@ int RGWRados::Object::Write::_do_write_meta(const DoutPrefixProvider *dpp,
   return 0;
 
 done_cancel:
-  int ret = index_op->cancel(dpp, meta.remove_objs, y, log_op);
-  if (ret < 0) {
-    ldpp_dout(dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl;
-  }
+  // if r == -ETIMEDOUT, rgw can't determine whether or not the rados op succeeded
+  // we shouldn't be calling index_op->cancel() in this case
+  // Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes()
+  if (r != -ETIMEDOUT) {
+    int ret = index_op->cancel(dpp, meta.remove_objs, y, log_op);
+    if (ret < 0) {
+      ldpp_dout(dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl;
+    }
 
-  meta.canceled = true;
+    meta.canceled = true;
+  }
 
   /* we lost in a race. There are a few options:
    * - existing object was rewritten (ECANCELED)