Skip to content

Commit 388cff0

Browse files
authored
Merge pull request ceph#63935 from tchaikov/wip-bluestore-exclude-unencoded-field-in-dump
os/bluestore: use default value for non-decoded field in test instances Reviewed-by: Igor Fedotov <[email protected]>
2 parents d8b1a84 + 2426c11 commit 388cff0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/os/bluestore/bluestore_types.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,16 @@ void bluestore_shared_blob_t::dump(Formatter *f) const
13611361
void bluestore_shared_blob_t::generate_test_instances(
13621362
list<bluestore_shared_blob_t*>& ls)
13631363
{
1364-
ls.push_back(new bluestore_shared_blob_t(1));
1364+
std::list<bluestore_extent_ref_map_t*> extent_ref_maps;
1365+
bluestore_extent_ref_map_t::generate_test_instances(extent_ref_maps);
1366+
// use 0 for sbid, as this field is not persited, and is always set during
1367+
// instance construction, so including a non-default value in dumps would
1368+
// cause ceph-dencoder verification failures when comparing original and
1369+
// re-encoded value.
1370+
ls.push_back(new bluestore_shared_blob_t{0, std::move(*extent_ref_maps.front())});
1371+
for (auto* m : extent_ref_maps) {
1372+
delete m;
1373+
}
13651374
}
13661375

13671376
ostream& operator<<(ostream& out, const bluestore_shared_blob_t& sb)

0 commit comments

Comments
 (0)