Skip to content

Commit

Permalink
mon: no delay for single message MSG_ALIVE and MSG_PGTEMP
Browse files Browse the repository at this point in the history
delay and batch proposed as before if lots of messages arrive at the same time

if too many messages are MSG_ALIVE and MSG_PGTEMP, wait a long period as before

Signed-off-by: yaoning <yaoning@unitedstack.com>
  • Loading branch information
yaoning committed Jan 11, 2017
1 parent a70dc74 commit 710dca8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -80,6 +80,7 @@ OSDMonitor::OSDMonitor(CephContext *cct, Monitor *mn, Paxos *p, const string& se
cct(cct),
inc_osd_cache(g_conf->mon_osd_cache_size),
full_osd_cache(g_conf->mon_osd_cache_size),
last_attempped_nowait_time(utime_t()),
thrash_map(0), thrash_last_up_osd(-1),
op_tracker(cct, true, 1)
{}
Expand Down Expand Up @@ -1481,6 +1482,21 @@ bool OSDMonitor::should_propose(double& delay)
return true;
}

// propose as fast as possible if updating up_thru or pg_temp
// want to merge OSDMap changes as much as possible
if ((pending_inc.new_primary_temp.size() == 1
|| pending_inc.new_up_thru.size() == 1)
&& pending_inc.new_state.size() < 2) {
dout(15) << " propose as fast as possible for up_thru/pg_temp" << dendl;

utime_t now = ceph_clock_now(NULL);
if (now - last_attempped_nowait_time > g_conf->paxos_propose_interval) {
delay = g_conf->paxos_min_wait;
last_attempped_nowait_time = now;
return true;
}
}

return PaxosService::should_propose(delay);
}

Expand Down
3 changes: 3 additions & 0 deletions src/mon/OSDMonitor.h
Expand Up @@ -131,6 +131,9 @@ class OSDMonitor : public PaxosService {
bool check_failure(utime_t now, int target_osd, failure_info_t& fi);
void force_failure(utime_t now, int target_osd);

// the time of last msg(MSG_ALIVE and MSG_PGTEMP) proposed without delay
utime_t last_attempped_nowait_time;

// map thrashing
int thrash_map;
int thrash_last_up_osd;
Expand Down

0 comments on commit 710dca8

Please sign in to comment.