From: Xuehan Xu Date: Wed, 6 Mar 2024 05:49:43 +0000 (+0800) Subject: crimson/os/seastore/collection_manager: allow empty-delta-buffer X-Git-Tag: v20.0.0~2444^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55981%2Fhead;p=ceph.git crimson/os/seastore/collection_manager: allow empty-delta-buffer collection nodes Fixes: https://tracker.ceph.com/issues/64728 Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/collection_manager/collection_flat_node.h b/src/crimson/os/seastore/collection_manager/collection_flat_node.h index 2690fb5fdf46..aa1e71356130 100644 --- a/src/crimson/os/seastore/collection_manager/collection_flat_node.h +++ b/src/crimson/os/seastore/collection_manager/collection_flat_node.h @@ -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; }