]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix semantic error prepare_update return
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 13 Mar 2023 14:25:55 +0000 (10:25 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 10 Apr 2023 18:44:47 +0000 (14:44 -0400)
The return value is used to indicate whether the pending state should be
committed. There is no concept of "handled message" here (unlike
preprocess_query).

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 8caa1fd5abe0fd16e579e10a1ad45a4147994862)

src/mon/MgrMonitor.cc
src/mon/PaxosService.h

index 170e2b53b5227bf6482d4f45dcd7e824205471f6..271c86cdb9a0175fd86932bfa37b8a1ab1d0adb7 100644 (file)
@@ -455,13 +455,13 @@ bool MgrMonitor::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! */
       }
 
     default:
       mon.no_reply(op);
       derr << "Unhandled message type " << m->get_type() << dendl;
-      return true;
+      return false; /* nothing to propose! */
   }
 }
 
index 93c5e7c81f93273be882459b6365659dfa6291ab..de3145b9bbabc7556653def411e10543c273bb4d 100644 (file)
@@ -358,8 +358,7 @@ public:
    * @invariant This function is only called on a Leader.
    *
    * @param m An update message
-   * @returns 'true' if the update message was handled (e.g., a command that
-   *         went through); 'false' otherwise.
+   * @returns 'true' if the pending state should be proposed; 'false' otherwise.
    */
   virtual bool prepare_update(MonOpRequestRef op) = 0;
   /**