Merge pull request #55981 from xxhdx1985126/wip-64728

crimson/os/seastore/collection_manager: allow empty-delta-buffer collection nodes

Reviewed-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin 2024-03-08 15:57:54 +08:00 committed by GitHub
commit da00a00b0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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