Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon/MgrMonitor: read cmd descs if empty on update_from_paxos() #17846

Merged
merged 1 commit into from Sep 29, 2017

Conversation

jecluis
Copy link
Member

@jecluis jecluis commented Sep 20, 2017

If the MgrMonitor's command_descs is empty, the monitor will not send
the mgr commands to clients on get_descriptions. This, in turn, has
the clients sending the commands to the monitors, which will have no
idea how to handle them.

Therefore, make sure to read the command_descs from disk if the vector
is empty.

Fixes: http://tracker.ceph.com/issues/21300

Signed-off-by: Joao Eduardo Luis <joao@suse.de>

If the MgrMonitor's `command_descs` is empty, the monitor will not send
the mgr commands to clients on `get_descriptions`. This, in turn, has
the clients sending the commands to the monitors, which will have no
idea how to handle them.

Therefore, make sure to read the `command_descs` from disk if the vector
is empty.

Fixes: http://tracker.ceph.com/issues/21300

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
@liewegas
Copy link
Member

no need for needs-backport tag if there is a tracker ticket with the backport field populated.

@renhwztetecs
Copy link
Contributor

very good, hope to catch up with 12.2.1

@@ -84,8 +84,9 @@ void MgrMonitor::update_from_paxos(bool *need_bootstrap)
check_subs();

if (version == 1
|| (map.get_available()
&& (!old_available || old_gid != map.get_active_gid()))) {
|| command_descs.empty()
Copy link
Contributor

@tchaikov tchaikov Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is no active mgr, why shall we load the cmd desc for the mon client and redirect it to a nonexistent mgr? the net result is that it will be waiting for an active mgr in mgrmap. and in theory, the command_desc could be stale once the new mgr is activated, as it will send a beacon to mon and update it with the commands it will be able to serve. and the "commands" here could be different from the ones stored in monstore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch relies on the assumption that a client will always block if there is no active mgr. That was a question I posed on ceph-devel before working on the patch, and Sage's reply was that the client is supposed to hang.
Given it's the monitor's responsibility to tag (by means of flags) which commands are the mgr's, we need to have a list of mgr commands that can be relayed to the client -- even if that means to relay a stale list, given we know of no active mgr's command list, so that the client can hang waiting for an active mgr.
Now, if it is established that the client is not supposed to hang, instead getting an EINVAL because the monitor does not handle the command, nor does it know of any manager that will, then a different patch needs to be worked on.

Copy link
Contributor

@tchaikov tchaikov Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the client is supposed to hang.

ahh, lgtm then.

@jecluis
Copy link
Member Author

jecluis commented Sep 26, 2017

holding back merge a little bit longer to finish some local tests.

@jecluis
Copy link
Member Author

jecluis commented Sep 27, 2017

@liewegas @tchaikov mind taking a look over the latest patch?

This needs to go through another batch of tests to make sure it works. And I think it will need a new test as well, to exercise an upgrade path in which the user runs ceph osd require-osd-release luminous without ever having had a mgr.

// command_descs vector. This likely means we came from kraken, where
// we wouldn't populate the vector, nor would we write it to disk, on
// create_initial().
create_initial();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should have this in luminous. but i am not sure if we need it in master (i.e. mimic) if our upgrade path is something like: jewel/kraken => luminous (not optional) => mimic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liewegas can you please confirm what kefu mentioned about luminous being a required step in the upgrade path from kraken to mimic? if this is confirmed, I'll be happy to have this patch targeting solely luminous.

@liewegas
Copy link
Member

Yep, confirmed. We've already merged a ton of stuff ot master ripping out pre-luminous support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants