]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/collection_manager: allow empty-delta-buffer 55981/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 6 Mar 2024 05:49:43 +0000 (13:49 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Thu, 7 Mar 2024 09:03:30 +0000 (17:03 +0800)
collection nodes

Fixes: https://tracker.ceph.com/issues/64728
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/collection_manager/collection_flat_node.h

index 2690fb5fdf464bd64a48cb7935a8bb58367f255d..aa1e71356130825c1f4b80fea00127638e906d9d 100644 (file)
@@ -153,10 +153,19 @@ struct CollectionNode
   }
 
   ceph::bufferlist get_delta() final {
-    assert(!delta_buffer.empty());
     ceph::bufferlist bl;
-    encode(delta_buffer, bl);
-    delta_buffer.clear();
+    // FIXME: CollectionNodes are always first mutated and
+    //               then checked whether they have enough space,
+    //               and if not, new ones will be created and the
+    //               mutation_pending ones are left untouched.
+    //
+    //               The above order should be reversed, nodes should
+    //               be mutated only if there are enough space for new
+    //               entries.
+    if (!delta_buffer.empty()) {
+      encode(delta_buffer, bl);
+      delta_buffer.clear();
+    }
     return bl;
   }