Skip to content

Commit

Permalink
Merge pull request #13888 from liewegas/wip-bluestore-dw
Browse files Browse the repository at this point in the history
os/bluestore: fix deferred writes; improve flush

Reviewed-by: Igor Fedotov <ifedotov@mirantis.com>
  • Loading branch information
liewegas committed Mar 21, 2017
2 parents 5444c9d + def1760 commit 66b42be
Show file tree
Hide file tree
Showing 14 changed files with 1,234 additions and 971 deletions.
7 changes: 7 additions & 0 deletions src/common/Throttle.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ class Throttle {
*/
int64_t get_max() const { return max.read(); }

/**
* return true if past midpoint
*/
bool past_midpoint() const {
return count.read() >= max.read() / 2;
}

/**
* set the new max number, and wait until the number of taken slots drains
* and drops below this limit.
Expand Down
16 changes: 6 additions & 10 deletions src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,9 +1051,9 @@ OPTION(bluestore_min_alloc_size, OPT_U32, 0)
OPTION(bluestore_min_alloc_size_hdd, OPT_U32, 64*1024)
OPTION(bluestore_min_alloc_size_ssd, OPT_U32, 4*1024)
OPTION(bluestore_max_alloc_size, OPT_U32, 0)
OPTION(bluestore_prefer_wal_size, OPT_U32, 0)
OPTION(bluestore_prefer_wal_size_hdd, OPT_U32, 32768)
OPTION(bluestore_prefer_wal_size_ssd, OPT_U32, 0)
OPTION(bluestore_prefer_deferred_size, OPT_U32, 0)
OPTION(bluestore_prefer_deferred_size_hdd, OPT_U32, 32768)
OPTION(bluestore_prefer_deferred_size_ssd, OPT_U32, 0)
OPTION(bluestore_compression_mode, OPT_STR, "none") // force|aggressive|passive|none
OPTION(bluestore_compression_algorithm, OPT_STR, "snappy")
OPTION(bluestore_compression_min_blob_size, OPT_U32, 128*1024)
Expand Down Expand Up @@ -1104,14 +1104,11 @@ OPTION(bluestore_fsck_on_umount_deep, OPT_BOOL, true)
OPTION(bluestore_fsck_on_mkfs, OPT_BOOL, true)
OPTION(bluestore_fsck_on_mkfs_deep, OPT_BOOL, false)
OPTION(bluestore_sync_submit_transaction, OPT_BOOL, false) // submit kv txn in queueing thread (not kv_sync_thread)
OPTION(bluestore_sync_wal_apply, OPT_BOOL, true) // perform initial wal work synchronously (possibly in combination with aio so we only *queue* ios)
OPTION(bluestore_wal_threads, OPT_INT, 4)
OPTION(bluestore_wal_thread_timeout, OPT_INT, 30)
OPTION(bluestore_wal_thread_suicide_timeout, OPT_INT, 120)
OPTION(bluestore_max_ops, OPT_U64, 512)
OPTION(bluestore_max_bytes, OPT_U64, 64*1024*1024)
OPTION(bluestore_wal_max_ops, OPT_U64, 512)
OPTION(bluestore_wal_max_bytes, OPT_U64, 128*1024*1024)
OPTION(bluestore_deferred_max_ops, OPT_U64, 512)
OPTION(bluestore_deferred_max_bytes, OPT_U64, 128*1024*1024)
OPTION(bluestore_deferred_batch_ops, OPT_U64, 8)
OPTION(bluestore_nid_prealloc, OPT_INT, 1024)
OPTION(bluestore_blobid_prealloc, OPT_U64, 10240)
OPTION(bluestore_clone_cow, OPT_BOOL, true) // do copy-on-write for clones
Expand All @@ -1126,7 +1123,6 @@ OPTION(bluestore_debug_prefragment_max, OPT_INT, 1048576)
OPTION(bluestore_debug_inject_read_err, OPT_BOOL, false)
OPTION(bluestore_debug_randomize_serial_transaction, OPT_INT, 0)
OPTION(bluestore_debug_omit_block_device_write, OPT_BOOL, false)
OPTION(bluestore_inject_wal_apply_delay, OPT_FLOAT, 0)
OPTION(bluestore_shard_finishers, OPT_BOOL, false)

OPTION(kstore_max_ops, OPT_U64, 512)
Expand Down
12 changes: 11 additions & 1 deletion src/os/ObjectStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ class ObjectStore {
*/
struct Sequencer_impl : public RefCountedObject {
CephContext* cct;

// block until any previous transactions are visible. specifically,
// collection_list and collection_empty need to reflect prior operations.
virtual void flush() = 0;

// called when we are done with the impl. the impl may have a different
// (longer) lifecycle than the Sequencer.
virtual void discard() {}

/**
* Async flush_commit
*
Expand Down Expand Up @@ -165,8 +172,11 @@ class ObjectStore {
Sequencer_implRef p;

explicit Sequencer(string n)
: name(n), shard_hint(spg_t()), p(NULL) {}
: name(n), shard_hint(spg_t()), p(NULL) {
}
~Sequencer() {
if (p)
p->discard(); // tell impl we are done with it
}

/// return a unique string identifier for this sequencer
Expand Down

0 comments on commit 66b42be

Please sign in to comment.