OPTION(bluefs_buffered_io, OPT_BOOL)
OPTION(bluefs_sync_write, OPT_BOOL)
OPTION(bluefs_allocator, OPT_STR) // stupid | bitmap
-OPTION(bluefs_preextend_wal_files, OPT_BOOL) // this *requires* that rocksdb has recycling enabled
OPTION(bluefs_log_replay_check_allocations, OPT_BOOL)
OPTION(bluestore_bluefs, OPT_BOOL)
.set_enum_allowed({"bitmap", "stupid", "avl", "hybrid"})
.set_description(""),
- Option("bluefs_preextend_wal_files", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
- .set_default(true)
- .set_description("Preextent rocksdb wal files on mkfs to avoid performance penalty"),
-
Option("bluefs_log_replay_check_allocations", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description("Enables checks for allocations consistency during log replay"),
// do not bother to dirty the file if we are overwriting
// previously allocated extents.
bool must_dirty = false;
- uint64_t clear_upto = 0;
if (allocated < offset + length) {
// we should never run out of log space here; see the min runway check
// in _flush_and_sync_log.
ceph_abort_msg("bluefs enospc");
return r;
}
- if (cct->_conf->bluefs_preextend_wal_files &&
- h->writer_type == WRITER_WAL) {
- // NOTE: this *requires* that rocksdb also has log recycling
- // enabled and is therefore doing robust CRCs on the log
- // records. otherwise, we will fail to reply the rocksdb log
- // properly due to garbage on the device.
- h->file->fnode.size = h->file->fnode.get_allocated();
- clear_upto = h->file->fnode.size;
- dout(10) << __func__ << " extending WAL size to 0x" << std::hex
- << h->file->fnode.size << std::dec << " to include allocated"
- << dendl;
- }
must_dirty = true;
}
if (h->file->fnode.size < offset + length) {
}
}
}
- if (length == partial + h->buffer.length() || clear_upto != 0) {
+ if (length == partial + h->buffer.length()) {
/* in case of inital allocation and need to zero, limited flush is unacceptable */
bl.claim_append_piecewise(h->buffer);
} else {
} else {
h->tail_block.clear();
}
- if (clear_upto != 0) {
- if (offset + length < clear_upto) {
- dout(20) << __func__ << " zeroing WAL log up to 0x"
- << std::hex << clear_upto
- << std::dec << dendl;
- bl.append_zero(clear_upto - (offset + length));
- length += clear_upto - (offset + length);
- }
- }
ceph_assert(bl.length() == length);
switch (h->writer_type) {