Skip to content

Commit da00a00

Browse files
authored
Merge pull request ceph#55981 from xxhdx1985126/wip-64728
crimson/os/seastore/collection_manager: allow empty-delta-buffer collection nodes Reviewed-by: Yingxin Cheng <[email protected]>
2 parents efc5984 + e8b9ab7 commit da00a00

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/crimson/os/seastore/collection_manager/collection_flat_node.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,19 @@ struct CollectionNode
153153
}
154154

155155
ceph::bufferlist get_delta() final {
156-
assert(!delta_buffer.empty());
157156
ceph::bufferlist bl;
158-
encode(delta_buffer, bl);
159-
delta_buffer.clear();
157+
// FIXME: CollectionNodes are always first mutated and
158+
// then checked whether they have enough space,
159+
// and if not, new ones will be created and the
160+
// mutation_pending ones are left untouched.
161+
//
162+
// The above order should be reversed, nodes should
163+
// be mutated only if there are enough space for new
164+
// entries.
165+
if (!delta_buffer.empty()) {
166+
encode(delta_buffer, bl);
167+
delta_buffer.clear();
168+
}
160169
return bl;
161170
}
162171

0 commit comments

Comments
 (0)