The _zero() process may implicitly create a new onode,
thus we shall call _assign_nid() to initialize the nid
properly. And if the onode already has one, _assign_nid()
does nothing.
So it is proper to call _assign_nid() here under any case.
Mark's comments:
This passed "ceph_test_objectstore --gtest_filter=*/2".
This PR did not appear to have a significant impact on performance tests.
Closes #10236
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
os/bluestore: check against we don't overflow
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
os/bluestore: try to reap as many collections as we can
So if there is one collection getting contiguously stucking,
we don't abort at the same point each time.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
os/bluestore: make device size of BitFreelistManager is block-size aligned
Otherwise if we try to set past-eof blocks as allocated durint create(),
the call to _xor() will trigger the firing of the following assert:
assert((length & block_mask) == length);
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
int BitmapFreelistManager::create(uint64_t new_size, KeyValueDB::Transaction txn)
{
- size = new_size;
bytes_per_block = g_conf->bdev_block_size;
+ assert(ISP2(bytes_per_block));
+ size = P2ALIGN(new_size, bytes_per_block);
blocks_per_key = g_conf->bluestore_freelist_blocks_per_key;
_init_misc();
removed_colls.swap(removed_collections);
}
+ bool all_reaped = true;
+
for (list<CollectionRef>::iterator p = removed_colls.begin();
p != removed_colls.end();
++p) {
}
return true;
})) {
- return;
+ all_reaped = false;
+ continue;
}
c->onode_map.clear();
dout(10) << __func__ << " " << c->cid << " done" << dendl;
}
- dout(10) << __func__ << " all reaped" << dendl;
+ if (all_reaped) {
+ dout(10) << __func__ << " all reaped" << dendl;
+ }
}
// ---------------
} else {
uint64_t l = length - pos;
if (pr != pr_end) {
+ assert(pr->first > pos + offset);
l = pr->first - (pos + offset);
}
dout(30) << __func__ << " assemble 0x" << std::hex << pos
<< dendl;
int r = 0;
o->exists = true;
+ _assign_nid(txc, o);
_dump_onode(o);