]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: do not propose on error in prepare_update 52239/head
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 13 Mar 2023 16:14:42 +0000 (12:14 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 28 Jun 2023 15:40:20 +0000 (11:40 -0400)
There is nothing to propose in pending map when an error is encountered.

Fixes: https://tracker.ceph.com/issues/58971
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 22d0a7b13c4e6d8615e32a3447ea6ea8c0c82e5e)

src/mon/MDSMonitor.cc

index 638612df8839967a2a0585b436b56c56ea8c929c..8a38ee4b1a6c5c8f757e56099a761ba066eb819e 100644 (file)
@@ -554,7 +554,7 @@ bool MDSMonitor::prepare_update(MonOpRequestRef op)
     } catch (const bad_cmd_get& e) {
       bufferlist bl;
       mon.reply_command(op, -EINVAL, e.what(), bl, get_last_committed());
-      return true;
+      return false; /* nothing to propose */
     }
 
   case MSG_MDS_OFFLOAD_TARGETS:
@@ -564,7 +564,7 @@ bool MDSMonitor::prepare_update(MonOpRequestRef op)
     ceph_abort();
   }
 
-  return true;
+  return false; /* nothing to propose! */
 }
 
 bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
@@ -864,6 +864,7 @@ null:
 bool MDSMonitor::prepare_offload_targets(MonOpRequestRef op)
 {
   auto &pending = get_pending_fsmap_writeable();
+  bool propose = false;
 
   op->mark_mdsmon_event(__func__);
   auto m = op->get_req<MMDSLoadTargets>();
@@ -871,11 +872,12 @@ bool MDSMonitor::prepare_offload_targets(MonOpRequestRef op)
   if (pending.gid_has_rank(gid)) {
     dout(10) << "prepare_offload_targets " << gid << " " << m->targets << dendl;
     pending.update_export_targets(gid, m->targets);
+    propose = true;
   } else {
     dout(10) << "prepare_offload_targets " << gid << " not in map" << dendl;
   }
   mon.no_reply(op);
-  return true;
+  return propose;
 }
 
 bool MDSMonitor::should_propose(double& delay)
@@ -1362,7 +1364,7 @@ bool MDSMonitor::prepare_command(MonOpRequestRef op)
   if (!cmdmap_from_json(m->cmd, &cmdmap, ss)) {
     string rs = ss.str();
     mon.reply_command(op, -EINVAL, rs, rdata, get_last_committed());
-    return true;
+    return false;
   }
 
   string prefix;
@@ -1372,7 +1374,7 @@ bool MDSMonitor::prepare_command(MonOpRequestRef op)
   MonSession *session = op->get_session();
   if (!session) {
     mon.reply_command(op, -EACCES, "access denied", rdata, get_last_committed());
-    return true;
+    return false;
   }
 
   auto &pending = get_pending_fsmap_writeable();