]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: services: use op-based wait_for_* functions
authorJoao Eduardo Luis <joao@suse.de>
Wed, 10 Jun 2015 00:52:15 +0000 (01:52 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:06:07 +0000 (18:06 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/AuthMonitor.cc
src/mon/LogMonitor.cc
src/mon/MDSMonitor.cc
src/mon/Monitor.cc
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/mon/PaxosService.cc

index 4a6308b51274a46fac4e19e7a0e5c2adfa5f1b31..a82dbb71f0cbb7d29f5d5c99fa4a75aedcdcd94e 100644 (file)
@@ -448,7 +448,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
 
       if (mon->is_leader() && paxos_writable) {
         dout(10) << "increasing global id, waitlisting message" << dendl;
-        wait_for_active(new C_RetryMessage(this, op));
+        wait_for_active(op, new C_RetryMessage(this, op));
         goto done;
       }
 
@@ -460,7 +460,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
        MMonGlobalID *req = new MMonGlobalID();
        req->old_max_id = max_global_id;
        mon->messenger->send_message(req, mon->monmap->get_inst(leader));
-       wait_for_finished_proposal(new C_RetryMessage(this, op));
+       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
        return true;
       }
 
@@ -487,7 +487,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
       ret = s->auth_handler->handle_request(indata, response_bl, s->global_id, caps_info, &auid);
     }
     if (ret == -EIO) {
-      wait_for_active(new C_RetryMessage(this,op));
+      wait_for_active(op, new C_RetryMessage(this,op));
       goto done;
     }
     if (caps_info.caps.length()) {
@@ -731,7 +731,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
     ss << "imported keyring";
     getline(ss, rs);
     err = 0;
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "auth add" && !entity_name.empty()) {
@@ -768,7 +768,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
         ::decode(inc, q);
         if (inc.op == KeyServerData::AUTH_INC_ADD &&
             inc.name == entity) {
-          wait_for_finished_proposal(
+          wait_for_finished_proposal(op,
               new Monitor::C_Command(mon, op, 0, rs, get_last_committed() + 1));
           return true;
         }
@@ -854,7 +854,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
 
     ss << "added key for " << auth_inc.name;
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                   get_last_committed() + 1));
     return true;
   } else if ((prefix == "auth get-or-create-key" ||
@@ -912,7 +912,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
        ::decode(auth_inc, q);
        if (auth_inc.op == KeyServerData::AUTH_INC_ADD &&
            auth_inc.name == entity) {
-         wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+         wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                get_last_committed() + 1));
          return true;
        }
@@ -948,7 +948,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
 
     rdata.append(ds);
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs, rdata,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs, rdata,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "auth caps" && !entity_name.empty()) {
@@ -976,7 +976,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
 
     ss << "updated caps for " << auth_inc.name;
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "auth del" && !entity_name.empty()) {
@@ -992,7 +992,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
 
     ss << "updated";
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   }
index 01a039f339c93a233efb6353c729ee9526255aa6..b7e338e49995eb1d24a41ce9d383c4949ebc6957 100644 (file)
@@ -348,7 +348,7 @@ bool LogMonitor::prepare_log(MonOpRequestRef op)
       pending_log.insert(pair<utime_t,LogEntry>(p->stamp, *p));
     }
   }
-  wait_for_finished_proposal(new C_Log(this, op));
+  wait_for_finished_proposal(op, new C_Log(this, op));
   return true;
 }
 
@@ -423,8 +423,8 @@ bool LogMonitor::prepare_command(MonOpRequestRef op)
     le.msg = str_join(logtext, " ");
     pending_summary.add(le);
     pending_log.insert(pair<utime_t,LogEntry>(le.stamp, le));
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, string(),
-                                             get_last_committed() + 1));
+    wait_for_finished_proposal(op, new Monitor::C_Command(
+          mon, op, 0, string(), get_last_committed() + 1));
     return true;
   }
 
index 2eabae3d89a831f9cc3ac7b99251680633d4383b..3de78d67a2e1c992693420cbf8c23c1e1d8bc1fb 100644 (file)
@@ -452,7 +452,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       bool failed_mds = false;
       while (mds_gid_t existing = pending_mdsmap.find_mds_gid_by_name(m->get_name())) {
         if (!mon->osdmon()->is_writeable()) {
-          mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, op));
+          mon->osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
           return false;
         }
        fail_mds_gid(existing);
@@ -559,7 +559,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       if (!mon->osdmon()->is_writeable()) {
         dout(4) << __func__ << ": DAMAGED from rank " << info.rank
                 << " waiting for osdmon writeable to blacklist it" << dendl;
-        mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, op));
+        mon->osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
         return false;
       }
 
@@ -591,7 +591,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       if (!mon->osdmon()->is_writeable()) {
         dout(4) << __func__ << ": DNE from rank " << info.rank
                 << " waiting for osdmon writeable to blacklist it" << dendl;
-        mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, m));
+        mon->osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
         return false;
       }
 
@@ -611,7 +611,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
   dout(7) << "prepare_beacon pending map now:" << dendl;
   print_map(pending_mdsmap);
   
-  wait_for_finished_proposal(new C_Updated(this, op));
+  wait_for_finished_proposal(op, new C_Updated(this, op));
 
   return true;
 }
@@ -1100,7 +1100,7 @@ out:
 
   if (r >= 0) {
     // success.. delay reply
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, r, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, r, rs,
                                              get_last_committed() + 1));
     return true;
   } else {
@@ -1297,7 +1297,7 @@ int MDSMonitor::management_command(
       // propose.  We thus need to make sure the osdmon is writeable before
       // we do this, waiting if it's not.
       if (!mon->osdmon()->is_writeable()) {
-        mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, op));
+        mon->osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
         return -EAGAIN;
       }
 
@@ -1575,7 +1575,7 @@ int MDSMonitor::filesystem_command(
     cmd_getval(g_ceph_context, cmdmap, "who", who);
     r = fail_mds(ss, who);
     if (r < 0 && r == -EAGAIN) {
-      mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, op));
+      mon->osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
       return -EAGAIN; // don't propose yet; wait for message to be retried
     }
 
index ec90ad8b76f74f298e4392c71fee2500b492697a..e2bb76a5aecc2c77493a2c6131c8eaec46b93ceb 100644 (file)
@@ -4197,7 +4197,7 @@ void Monitor::handle_get_version(MonOpRequestRef op)
 
   if (svc) {
     if (!svc->is_readable()) {
-      svc->wait_for_readable(new C_RetryMessage(this, op));
+      svc->wait_for_readable(op, new C_RetryMessage(this, op));
       goto out;
     }
 
index 03d58745c8c63dd6fc4b62134450582b0cef2a06..a30faee32c81db9702a489ad1d779802d56f36d1 100644 (file)
@@ -353,7 +353,7 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
     pending_map.add(name, addr);
     pending_map.last_changed = ceph_clock_now(g_ceph_context);
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                      get_last_committed() + 1));
     return true;
 
index 3185700d941a628a93b9c6f2a06ad5bfd1e040ff..5b4740f39f52a58efdbbc3c9afd0e1c2cae1e69a 100644 (file)
@@ -1530,7 +1530,7 @@ bool OSDMonitor::prepare_mark_me_down(MonOpRequestRef op)
   mon->clog->info() << "osd." << target_osd << " marked itself down\n";
   pending_inc.new_state[target_osd] = CEPH_OSD_UP;
   if (m->request_ack)
-    wait_for_finished_proposal(new C_AckMarkedDown(this, op));
+    wait_for_finished_proposal(op, new C_AckMarkedDown(this, op));
   return true;
 }
 
@@ -1896,11 +1896,11 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
       // mark previous guy down
       pending_inc.new_state[from] = CEPH_OSD_UP;
     }
-    wait_for_finished_proposal(new C_RetryMessage(this, op));
+    wait_for_finished_proposal(op, new C_RetryMessage(this, op));
   } else if (pending_inc.new_up_client.count(from)) { //FIXME: should this be using new_up_client?
     // already prepared, just wait
     dout(7) << "prepare_boot already prepared, waiting on " << m->get_orig_source_addr() << dendl;
-    wait_for_finished_proposal(new C_RetryMessage(this, op));
+    wait_for_finished_proposal(op, new C_RetryMessage(this, op));
   } else {
     // mark new guy up.
     pending_inc.new_up_client[from] = m->get_orig_source_addr();
@@ -1994,7 +1994,7 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
     pending_inc.new_xinfo[from] = xi;
 
     // wait
-    wait_for_finished_proposal(new C_Booted(this, op));
+    wait_for_finished_proposal(op, new C_Booted(this, op));
   }
   return true;
 }
@@ -2064,7 +2064,7 @@ bool OSDMonitor::prepare_alive(MonOpRequestRef op)
   dout(7) << "prepare_alive want up_thru " << m->want << " have " << m->version
          << " from " << m->get_orig_source_inst() << dendl;
   pending_inc.new_up_thru[from] = m->version;  // set to the latest map the OSD has
-  wait_for_finished_proposal(new C_ReplyMap(this, op, m->version));
+  wait_for_finished_proposal(op, new C_ReplyMap(this, op, m->version));
   return true;
 }
 
@@ -2178,7 +2178,7 @@ bool OSDMonitor::prepare_pgtemp(MonOpRequestRef op)
       pending_inc.new_primary_temp[p->first] = -1;
   }
   pending_inc.new_up_thru[from] = m->map_epoch;   // set up_thru too, so the osd doesn't have to ask again
-  wait_for_finished_proposal(new C_ReplyMap(this, op, m->map_epoch));
+  wait_for_finished_proposal(op, new C_ReplyMap(this, op, m->map_epoch));
   return true;
 }
 
@@ -4433,7 +4433,7 @@ bool OSDMonitor::prepare_set_flag(MonOpRequestRef op, int flag)
     pending_inc.new_flags = osdmap.get_flags();
   pending_inc.new_flags |= flag;
   ss << "set " << OSDMap::get_flag_string(flag);
-  wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+  wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                                    get_last_committed() + 1));
   return true;
 }
@@ -4445,7 +4445,7 @@ bool OSDMonitor::prepare_unset_flag(MonOpRequestRef op, int flag)
     pending_inc.new_flags = osdmap.get_flags();
   pending_inc.new_flags &= ~flag;
   ss << "unset " << OSDMap::get_flag_string(flag);
-  wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+  wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                                    get_last_committed() + 1));
   return true;
 }
@@ -5078,7 +5078,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     ss << action << " item id " << osdid << " name '" << name << "' weight "
       << weight << " at location " << loc << " to crush map";
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                      get_last_committed() + 1));
     return true;
 
@@ -5123,7 +5123,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        ss << "create-or-move updating item name '" << name << "' weight " << weight
           << " at location " << loc << " to crush map";
        getline(ss, rs);
-       wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+       wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
        return true;
       }
@@ -5158,7 +5158,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
          pending_inc.crush.clear();
          newcrush.encode(pending_inc.crush);
          getline(ss, rs);
-         wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+         wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                   get_last_committed() + 1));
          return true;
        }
@@ -5220,7 +5220,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        err = 0;
       }
     }
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, err, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, err, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd crush rm" ||
@@ -5243,7 +5243,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        err = 0;
        ss << "device '" << name << "' does not appear in the crush map";
        getline(ss, rs);
-       wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+       wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
        return true;
       }
@@ -5273,7 +5273,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        newcrush.encode(pending_inc.crush);
        ss << "removed item id " << id << " name '" << name << "' from crush map";
        getline(ss, rs);
-       wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+       wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
        return true;
       }
@@ -5289,7 +5289,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     newcrush.encode(pending_inc.crush);
     ss << "reweighted crush hierarchy";
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
     return true;
   } else if (prefix == "osd crush reweight") {
@@ -5327,7 +5327,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     ss << "reweighted item id " << id << " name '" << name << "' to " << w
        << " in crush map";
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
     return true;
   } else if (prefix == "osd crush reweight-subtree") {
@@ -5365,7 +5365,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     ss << "reweighted subtree id " << id << " name '" << name << "' to " << w
        << " in crush map";
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd crush tunables") {
@@ -5402,7 +5402,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     newcrush.encode(pending_inc.crush);
     ss << "adjusted tunables profile to " << profile;
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd crush set-tunable") {
@@ -5442,7 +5442,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     newcrush.encode(pending_inc.crush);
     ss << "adjusted tunable " << tunable << " to " << value;
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -5483,7 +5483,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       newcrush.encode(pending_inc.crush);
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -5509,7 +5509,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       }
 
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                        get_last_committed() + 1));
       return true;
     } else {
@@ -5590,7 +5590,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     }
 
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                       get_last_committed() + 1));
     return true;
 
@@ -5651,7 +5651,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     }
 
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                       get_last_committed() + 1));
     return true;
 
@@ -5694,7 +5694,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       newcrush.encode(pending_inc.crush);
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -5734,7 +5734,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     pending_inc.new_max_osd = newmax;
     ss << "set new max_osd = " << pending_inc.new_max_osd;
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -5877,7 +5877,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     }
     if (any) {
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, err, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, err, rs,
                                                get_last_committed() + 1));
       return true;
     }
@@ -6016,7 +6016,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       pending_inc.new_primary_affinity[id] = ww;
       ss << "set osd." << id << " primary-affinity to " << w << " (" << ios::hex << ww << ios::dec << ")";
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                 get_last_committed() + 1));
       return true;
     }
@@ -6045,7 +6045,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       pending_inc.new_weight[id] = ww;
       ss << "reweighted osd." << id << " to " << w << " (" << ios::hex << ww << ios::dec << ")";
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                get_last_committed() + 1));
       return true;
     }
@@ -6071,7 +6071,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       pending_inc.new_lost[id] = e;
       ss << "marked osd lost in epoch " << e;
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                get_last_committed() + 1));
       return true;
     }
@@ -6130,14 +6130,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        }
        if (pending_inc.new_state.count(id)) {
          // osd is about to exist
-         wait_for_finished_proposal(new C_RetryMessage(this, op));
+         wait_for_finished_proposal(op, new C_RetryMessage(this, op));
          return true;
        }
        i = id;
       }
       if (pending_inc.identify_osd(uuid) >= 0) {
        // osd is about to exist
-       wait_for_finished_proposal(new C_RetryMessage(this, op));
+       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
        return true;
       }
       if (i >= 0) {
@@ -6178,7 +6178,7 @@ done:
       ss << i;
       rdata.append(ss);
     }
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs, rdata,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs, rdata,
                                              get_last_committed() + 1));
     return true;
 
@@ -6201,7 +6201,7 @@ done:
        pending_inc.new_blacklist[addr] = expires;
        ss << "blacklisting " << addr << " until " << expires << " (" << d << " sec)";
        getline(ss, rs);
-       wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+       wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                  get_last_committed() + 1));
        return true;
       } else if (blacklistop == "rm") {
@@ -6213,7 +6213,7 @@ done:
            pending_inc.new_blacklist.erase(addr);
          ss << "un-blacklisting " << addr;
          getline(ss, rs);
-         wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+         wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                    get_last_committed() + 1));
          return true;
        }
@@ -6258,7 +6258,7 @@ done:
       ss << "created pool " << poolstr << " snap " << snapname;
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd pool rmsnap") {
@@ -6298,7 +6298,7 @@ done:
       ss << "already removed pool " << poolstr << " snap " << snapname;
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd pool create") {
@@ -6392,7 +6392,7 @@ done:
       int ruleset;
       err = get_crush_ruleset(ruleset_name, &ruleset, &ss);
       if (err == -EAGAIN) {
-       wait_for_finished_proposal(new C_RetryMessage(this, op));
+       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
        return true;
       }
       if (err)
@@ -6419,7 +6419,7 @@ done:
        ss << "pool '" << poolstr << "' already exists";
        break;
       case -EAGAIN:
-       wait_for_finished_proposal(new C_RetryMessage(this, op));
+       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
        return true;
       case -ERANGE:
         goto reply;
@@ -6431,7 +6431,7 @@ done:
       ss << "pool '" << poolstr << "' created";
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -6457,7 +6457,7 @@ done:
     }
     err = _prepare_remove_pool(pool, &ss);
     if (err == -EAGAIN) {
-      wait_for_finished_proposal(new C_RetryMessage(this, op));
+      wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
     if (err < 0)
@@ -6501,7 +6501,7 @@ done:
         << cpp_strerror(ret);
     }
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, ret, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, ret, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -6513,7 +6513,7 @@ done:
       goto reply;
 
     getline(ss, rs);
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                   get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier add") {
@@ -6575,14 +6575,14 @@ done:
     pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
     pg_pool_t *ntp = pending_inc.get_new_pool(tierpool_id, tp);
     if (np->tiers.count(tierpool_id) || ntp->is_tier()) {
-      wait_for_finished_proposal(new C_RetryMessage(this, op));
+      wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
     np->tiers.insert(tierpool_id);
     np->set_snap_epoch(pending_inc.epoch); // tier will update to our snap info
     ntp->tier_of = pool_id;
     ss << "pool '" << tierpoolstr << "' is now (or already was) a tier of '" << poolstr << "'";
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier remove") {
@@ -6635,13 +6635,13 @@ done:
     if (np->tiers.count(tierpool_id) == 0 ||
        ntp->tier_of != pool_id ||
        np->read_tier == tierpool_id) {
-      wait_for_finished_proposal(new C_RetryMessage(this, op));
+      wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
     np->tiers.erase(tierpool_id);
     ntp->clear_tier();
     ss << "pool '" << tierpoolstr << "' is now (or already was) not a tier of '" << poolstr << "'";
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier set-overlay") {
@@ -6696,7 +6696,7 @@ done:
     ss << "overlay for '" << poolstr << "' is now (or already was) '" << overlaypoolstr << "'";
     if (overlay_p->cache_mode == pg_pool_t::CACHEMODE_NONE)
       ss <<" (WARNING: overlay pool cache_mode is still NONE)";
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier remove-overlay") {
@@ -6726,7 +6726,7 @@ done:
     np->clear_write_tier();
     np->last_force_op_resend = pending_inc.epoch;
     ss << "there is now (or already was) no overlay for '" << poolstr << "'";
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier cache-mode") {
@@ -6849,7 +6849,7 @@ done:
          base_pool->write_tier == pool_id)
        ss <<" (WARNING: pool is still configured as read or write tier)";
     }
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier add-cache") {
@@ -6925,7 +6925,7 @@ done:
     pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
     pg_pool_t *ntp = pending_inc.get_new_pool(tierpool_id, tp);
     if (np->tiers.count(tierpool_id) || ntp->is_tier()) {
-      wait_for_finished_proposal(new C_RetryMessage(this, op));
+      wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
     np->tiers.insert(tierpool_id);
@@ -6939,7 +6939,7 @@ done:
     ntp->hit_set_params = hsp;
     ntp->target_max_bytes = size;
     ss << "pool '" << tierpoolstr << "' is now (or already was) a cache tier of '" << poolstr << "'";
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, ss.str(),
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, ss.str(),
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd pool set-quota") {
@@ -6981,7 +6981,7 @@ done:
     }
     ss << "set-quota " << field << " = " << value << " for pool " << poolstr;
     rs = ss.str();
-    wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+    wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                              get_last_committed() + 1));
     return true;
 
@@ -6997,7 +6997,7 @@ done:
     } else {
       ss << "SUCCESSFUL reweight-by-utilization: " << out_str;
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                get_last_committed() + 1));
       return true;
     }
@@ -7026,7 +7026,7 @@ done:
     } else {
       ss << "SUCCESSFUL reweight-by-pg: " << out_str;
       getline(ss, rs);
-      wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+      wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                                get_last_committed() + 1));
       return true;
     }
@@ -7051,12 +7051,12 @@ done:
 
  update:
   getline(ss, rs);
-  wait_for_finished_proposal(new Monitor::C_Command(mon, op, 0, rs,
+  wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
                                            get_last_committed() + 1));
   return true;
 
  wait:
-  wait_for_finished_proposal(new C_RetryMessage(this, op));
+  wait_for_finished_proposal(op, new C_RetryMessage(this, op));
   return true;
 }
 
@@ -7290,14 +7290,14 @@ bool OSDMonitor::prepare_pool_op(MonOpRequestRef op)
   }
 
  out:
-  wait_for_finished_proposal(new OSDMonitor::C_PoolOp(this, op, ret, pending_inc.epoch, &reply_data));
+  wait_for_finished_proposal(op, new OSDMonitor::C_PoolOp(this, op, ret, pending_inc.epoch, &reply_data));
   return true;
 }
 
 bool OSDMonitor::prepare_pool_op_create(MonOpRequestRef op)
 {
   int err = prepare_new_pool(op);
-  wait_for_finished_proposal(new OSDMonitor::C_PoolOp(this, op, err, pending_inc.epoch));
+  wait_for_finished_proposal(op, new OSDMonitor::C_PoolOp(this, op, err, pending_inc.epoch));
   return true;
 }
 
@@ -7502,12 +7502,12 @@ bool OSDMonitor::prepare_pool_op_delete(MonOpRequestRef op)
   ostringstream ss;
   int ret = _prepare_remove_pool(m->pool, &ss);
   if (ret == -EAGAIN) {
-    wait_for_finished_proposal(new C_RetryMessage(this, op));
+    wait_for_finished_proposal(op, new C_RetryMessage(this, op));
     return true;
   }
   if (ret < 0)
     dout(10) << __func__ << " got " << ret << " " << ss.str() << dendl;
-  wait_for_finished_proposal(new OSDMonitor::C_PoolOp(this, op, ret,
+  wait_for_finished_proposal(op, new OSDMonitor::C_PoolOp(this, op, ret,
                                                      pending_inc.epoch));
   return true;
 }
index cf94e33ef7a854bbaf864290eada57645a99841d..a4226bccc14a527e9927d450743b40d59fbda5b0 100644 (file)
@@ -832,7 +832,7 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op)
     */
   }
   
-  wait_for_finished_proposal(new C_Stats(this, op, ack_op));
+  wait_for_finished_proposal(op, new C_Stats(this, op, ack_op));
   return true;
 }
 
@@ -1862,8 +1862,8 @@ bool PGMonitor::prepare_command(MonOpRequestRef op)
 
  update:
   getline(ss, rs);
-  wait_for_finished_proposal(new Monitor::C_Command(mon, op, r, rs,
-                                                   get_last_committed() + 1));
+  wait_for_finished_proposal(op, new Monitor::C_Command(
+        mon, op, r, rs, get_last_committed() + 1));
   return true;
 }
 
index cfbeb14fba0b811ce821f7ea5bb3d91ae3232449..690c580fb854190a7c8b7769e1983f45fe0be425 100644 (file)
@@ -67,7 +67,7 @@ bool PaxosService::dispatch(MonOpRequestRef op)
   // make sure our map is readable and up to date
   if (!is_readable(m->version)) {
     dout(10) << " waiting for paxos -> readable (v" << m->version << ")" << dendl;
-    wait_for_readable(new C_RetryMessage(this, op), m->version);
+    wait_for_readable(op, new C_RetryMessage(this, op), m->version);
     return true;
   }
 
@@ -84,7 +84,7 @@ bool PaxosService::dispatch(MonOpRequestRef op)
   // writeable?
   if (!is_writeable()) {
     dout(10) << " waiting for paxos -> writeable" << dendl;
-    wait_for_writeable(new C_RetryMessage(this, op));
+    wait_for_writeable(op, new C_RetryMessage(this, op));
     return true;
   }