Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: drop old bluestore preconditioning; replace with wal preextension of file size #12265

Merged
merged 2 commits into from Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/common/config_opts.h
Expand Up @@ -982,6 +982,7 @@ OPTION(bluefs_min_flush_size, OPT_U64, 65536) // ignore flush until its this bi
OPTION(bluefs_compact_log_sync, OPT_BOOL, false) // sync or async log compaction?
OPTION(bluefs_buffered_io, OPT_BOOL, false)
OPTION(bluefs_allocator, OPT_STR, "bitmap") // stupid | bitmap
OPTION(bluefs_preextend_wal_files, OPT_BOOL, true) // this *requires* that rocksdb has recycling enabled

OPTION(bluestore_bluefs, OPT_BOOL, true)
OPTION(bluestore_bluefs_env_mirror, OPT_BOOL, false) // mirror to normal Env for debug
Expand All @@ -1006,8 +1007,6 @@ OPTION(bluestore_block_wal_path, OPT_STR, "")
OPTION(bluestore_block_wal_size, OPT_U64, 96 * 1024*1024) // rocksdb wal
OPTION(bluestore_block_wal_create, OPT_BOOL, false)
OPTION(bluestore_block_preallocate_file, OPT_BOOL, false) //whether preallocate space if block/db_path/wal_path is file rather that block device.
OPTION(bluestore_precondition_bluefs, OPT_U64, 512*1024*1024) // write this much data at mkfs
OPTION(bluestore_precondition_bluefs_block, OPT_U64, 1048576)
OPTION(bluestore_csum_type, OPT_STR, "crc32c") // none|xxhash32|xxhash64|crc32c|crc32c_16|crc32c_8
OPTION(bluestore_csum_min_block, OPT_U32, 4096)
OPTION(bluestore_csum_max_block, OPT_U32, 64*1024)
Expand Down
11 changes: 11 additions & 0 deletions src/os/bluestore/BlueFS.cc
Expand Up @@ -1444,6 +1444,17 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
<< dendl;
return r;
}
if (g_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();
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) {
Expand Down
29 changes: 0 additions & 29 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -3895,35 +3895,6 @@ int BlueStore::mkfs()
goto out_close_alloc;
dout(10) << __func__ << " success" << dendl;

if (bluefs &&
g_conf->bluestore_precondition_bluefs > 0) {
dout(10) << __func__ << " preconditioning with "
<< pretty_si_t(g_conf->bluestore_precondition_bluefs)
<< " in blocks of "
<< pretty_si_t(g_conf->bluestore_precondition_bluefs_block)
<< dendl;
unsigned n = g_conf->bluestore_precondition_bluefs /
g_conf->bluestore_precondition_bluefs_block;
bufferlist bl;
int len = g_conf->bluestore_precondition_bluefs_block;
char buf[len];
get_random_bytes(buf, len);
bl.append(buf, len);
string key1("a");
string key2("b");
for (unsigned i=0; i < n; ++i) {
KeyValueDB::Transaction t = db->get_transaction();
t->set(PREFIX_SUPER, (i & 1) ? key1 : key2, bl);
t->rmkey(PREFIX_SUPER, (i & 1) ? key2 : key1);
db->submit_transaction_sync(t);
}
KeyValueDB::Transaction t = db->get_transaction();
t->rmkey(PREFIX_SUPER, key1);
t->rmkey(PREFIX_SUPER, key2);
db->submit_transaction_sync(t);
dout(10) << __func__ << " done preconditioning" << dendl;
}

out_close_alloc:
_close_alloc();
out_close_fm:
Expand Down