]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/collection_manager: allow empty-delta-buffer
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 6 Mar 2024 05:49:43 +0000 (13:49 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 7 May 2024 11:31:29 +0000 (14:31 +0300)
collection nodes

Fixes: https://tracker.ceph.com/issues/64728
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
(cherry picked from commit e8b9ab73f409d5d9a51100f5dd9922dfcab5dc0e)

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;
   }