OPTION(bluestore_fsck_on_mkfs, OPT_BOOL)
OPTION(bluestore_fsck_on_mkfs_deep, OPT_BOOL)
OPTION(bluestore_sync_submit_transaction, OPT_BOOL) // submit kv txn in queueing thread (not kv_sync_thread)
+OPTION(bluestore_fsck_read_bytes_cap, OPT_U64)
OPTION(bluestore_throttle_bytes, OPT_U64)
OPTION(bluestore_throttle_deferred_bytes, OPT_U64)
OPTION(bluestore_throttle_cost_per_io_hdd, OPT_U64)
.set_default(false)
.set_description("Try to submit metadata transaction to rocksdb in queuing thread context"),
+ Option("bluestore_fsck_read_bytes_cap", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
+ .set_default(64_M)
+ .set_flag(Option::FLAG_RUNTIME)
+ .set_description("Maximum bytes read at once by deep fsck"),
+
Option("bluestore_throttle_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
.set_default(64_M)
.set_flag(Option::FLAG_RUNTIME)
}
if (deep) {
bufferlist bl;
- int r = _do_read(c.get(), o, 0, o->onode.size, bl,
- CEPH_OSD_OP_FLAG_FADVISE_NOCACHE);
- if (r < 0) {
- ++errors;
- derr << "fsck error: " << oid << " error during read: "
- << cpp_strerror(r) << dendl;
- }
+ uint64_t max_read_block = cct->_conf->bluestore_fsck_read_bytes_cap;
+ uint64_t offset = 0;
+ do {
+ uint64_t l = std::min(uint64_t(o->onode.size - offset), max_read_block);
+ int r = _do_read(c.get(), o, offset, l, bl,
+ CEPH_OSD_OP_FLAG_FADVISE_NOCACHE);
+ if (r < 0) {
+ ++errors;
+ derr << "fsck error: " << oid << std::hex
+ << " error during read: "
+ << " " << offset << "~" << l
+ << " " << cpp_strerror(r) << std::dec
+ << dendl;
+ break;
+ }
+ offset += l;
+ } while (offset < o->onode.size);
}
// omap
if (o->onode.has_omap()) {