monc(mc),
logger(NULL), logger_started(false),
store(NULL),
+ map_in_progress(false),
logclient(cluster_messenger, &mc->monmap, mc),
whoami(id),
dev_path(dev), journal_path(jdev),
remove_wq(this, &disk_tp)
{
monc->set_messenger(client_messenger);
+ if (client_messenger != cluster_messenger)
+ handle_map_lock = new Mutex("OSD::handle_map_lock");
+ else handle_map_lock = NULL;
osdmap = 0;
if (session)
session->put();
+ if (handle_map_lock) {
+ handle_map_lock->Lock();
+ if (map_in_progress) {
+ dout(15) << "waiting for prior handle_osd_map to complete" << dendl;
+ Cond map_cond;
+ while (map_in_progress)
+ map_cond.Wait(*handle_map_lock);
+ }
+ dout(10) << "locking handle_osd_map permissions" << dendl;
+ map_in_progress = true;
+ handle_map_lock->Unlock();
+ }
+
if (osdmap) {
dout(3) << "handle_osd_map epochs ["
<< m->get_first() << "," << m->get_last()
if (is_booting())
send_boot();
+
+ if (handle_map_lock) {
+ handle_map_lock->Lock();
+ map_in_progress = false;
+ dout(15) << "unlocking map_in_progress" << dendl;
+ handle_map_lock->Unlock();
+ }
}