From: Patrick Donnelly Date: Mon, 13 Mar 2023 14:25:55 +0000 (-0400) Subject: mon: fix semantic error prepare_update return X-Git-Tag: v18.1.0~132^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96dc69d996fbb4bf7b1758c10c0d7e8aeea67287;p=ceph.git mon: fix semantic error prepare_update return 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 (cherry picked from commit 8caa1fd5abe0fd16e579e10a1ad45a4147994862) --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index 170e2b53b522..271c86cdb9a0 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -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! */ } } diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 93c5e7c81f93..de3145b9bbab 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -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; /**