]> git.apps.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>
Thu, 4 May 2023 22:22:24 +0000 (18:22 -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 55309e203d358ba599b10f66c92bfb0b3bf923e9..422724e70809463b7c506536e302f2b8a5ca7c3d 100644 (file)
@@ -441,13 +441,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;
   /**