Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sage Weil committed Mar 22, 2013
2 parents a35b865 + 38a5acb commit 0981e46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ OPTION(filestore_fail_eio, OPT_BOOL, true) // fail/crash on EIO
OPTION(filestore_replica_fadvise, OPT_BOOL, true)
OPTION(filestore_debug_verify_split, OPT_BOOL, false)
OPTION(journal_dio, OPT_BOOL, true)
OPTION(journal_aio, OPT_BOOL, false)
OPTION(journal_aio, OPT_BOOL, true)

// max bytes to search ahead in journal searching for corruption
OPTION(journal_max_corrupt_search, OPT_U64, 10<<20)
Expand Down
6 changes: 4 additions & 2 deletions src/mon/AuthMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,16 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable)
if (!s->global_id) {
s->global_id = assign_global_id(m, paxos_writable);
if (!s->global_id) {

delete s->auth_handler;
s->auth_handler = NULL;

if (mon->is_leader() && paxos_writable) {
dout(10) << "increasing global id, waitlisting message" << dendl;
wait_for_active(new C_RetryMessage(this, m));
goto done;
}

delete s->auth_handler;
s->auth_handler = NULL;
s->put();

if (!mon->is_leader()) {
Expand Down
25 changes: 17 additions & 8 deletions src/os/FileJournal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1127,19 +1127,28 @@ void FileJournal::write_thread_entry()
// should we back off to limit aios in flight? try to do this
// adaptively so that we submit larger aios once we have lots of
// them in flight.
int exp = MIN(aio_num * 2, 24);
long unsigned min_new = 1ull << exp;
long unsigned cur = throttle_bytes.get_current();
dout(20) << "write_thread_entry aio throttle: aio num " << aio_num << " bytes " << aio_bytes
<< " ... exp " << exp << " min_new " << min_new
<< " ... pending " << cur << dendl;
if (cur < min_new) {
//
// NOTE: our condition here is based on aio_num (protected by
// aio_lock) and throttle_bytes (part of the write queue). when
// we sleep, we *only* wait for aio_num to change, and do not
// wake when more data is queued. this is not strictly correct,
// but should be fine given that we will have plenty of aios in
// flight if we hit this limit to ensure we keep the device
// saturated.
while (aio_num > 0) {
int exp = MIN(aio_num * 2, 24);
long unsigned min_new = 1ull << exp;
long unsigned cur = throttle_bytes.get_current();
dout(20) << "write_thread_entry aio throttle: aio num " << aio_num << " bytes " << aio_bytes
<< " ... exp " << exp << " min_new " << min_new
<< " ... pending " << cur << dendl;
if (cur >= min_new)
break;
dout(20) << "write_thread_entry deferring until more aios complete: "
<< aio_num << " aios with " << aio_bytes << " bytes needs " << min_new
<< " bytes to start a new aio (currently " << cur << " pending)" << dendl;
aio_cond.Wait(aio_lock);
dout(20) << "write_thread_entry woke up" << dendl;
continue;
}
}
#endif
Expand Down

0 comments on commit 0981e46

Please sign in to comment.