]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: don't propagate split/merge error to "create"/"remove" 40989/head
authorMykola Golub <mgolub@suse.com>
Mon, 19 Apr 2021 07:32:01 +0000 (08:32 +0100)
committerMykola Golub <mgolub@suse.com>
Thu, 22 Apr 2021 15:24:00 +0000 (18:24 +0300)
Either ignore or terminate, otherwise it may confuse the
"create"/"remove" caller.

Fixes: https://tracker.ceph.com/issues/50395
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 936898b8caf7b13a120ea6108df0b0dac29882c4)

src/os/filestore/HashIndex.cc

index edd8339556f651b8c9b31b87d8d22115d63c9089..75c3d1b673b25970da1ef7d86ffe95609bffebc4 100644 (file)
@@ -552,15 +552,23 @@ int HashIndex::_created(const vector<string> &path,
     dout(1) << __func__ << " " << path << " has " << info.objs
             << " objects, starting split in pg " << coll() << "." << dendl;
     int r = initiate_split(path, info);
-    if (r < 0)
-      return r;
-    r = complete_split(path, info);
-    dout(1) << __func__ << " " << path << " split completed in pg " << coll() << "."
-            << dendl;
-    return r;
-  } else {
-    return 0;
+    if (r < 0) {
+      derr << __func__ << " error starting split " << path << " in pg "
+           << coll() << ": " << cpp_strerror(r) << dendl;
+      ceph_assert(!cct->_conf->filestore_fail_eio);
+    } else {
+      r = complete_split(path, info);
+      if (r < 0) {
+        derr << __func__ << " error completing split " << path << " in pg "
+             << coll() << ": " << cpp_strerror(r) << dendl;
+        ceph_assert(!cct->_conf->filestore_fail_eio);
+      }
+      dout(1) << __func__ << " " << path << " split completed in pg " << coll()
+              << "." << dendl;
+    }
   }
+
+  return 0;
 }
 
 int HashIndex::_remove(const vector<string> &path,
@@ -578,14 +586,28 @@ int HashIndex::_remove(const vector<string> &path,
   r = set_info(path, info);
   if (r < 0)
     return r;
+
   if (must_merge(info)) {
+    dout(1) << __func__ << " " << path << " has " << info.objs
+            << " objects, starting merge in pg " << coll() << "." << dendl;
     r = initiate_merge(path, info);
-    if (r < 0)
-      return r;
-    return complete_merge(path, info);
-  } else {
-    return 0;
+    if (r < 0) {
+      derr << __func__ << " error starting merge " << path << " in pg "
+           << coll() << ": " << cpp_strerror(r) << dendl;
+      ceph_assert(!cct->_conf->filestore_fail_eio);
+    } else {
+      r = complete_merge(path, info);
+      if (r < 0) {
+        derr << __func__ << " error completing merge " << path << " in pg "
+             << coll() << ": " << cpp_strerror(r) << dendl;
+        ceph_assert(!cct->_conf->filestore_fail_eio);
+      }
+      dout(1) << __func__ << " " << path << " merge completed in pg " << coll()
+              << "." << dendl;
+    }
   }
+
+  return 0;
 }
 
 int HashIndex::_lookup(const ghobject_t &oid,