Skip to content

mon: MonmapMonitor: don't expose uncommitted state to client - #6854

Merged
jecluis merged 1 commit into
ceph:masterfrom
jecluis:wip-monmapmon
Jan 4, 2016
Merged

jecluis merged 1 commit into
ceph:masterfrom
jecluis:wip-monmapmon

Conversation

@jecluis

@jecluis jecluis commented Dec 8, 2015

Copy link
Copy Markdown
Member

During prepare_command(), we were returning to the user based on
pending_map's state. Even though this weren't causing any issues we are
aware of, we really shouldn't do that.

Signed-off-by: Joao Eduardo Luis [email protected]

@jecluis

jecluis commented Dec 8, 2015

Copy link
Copy Markdown
Member Author

I've done some testing on this by running a bash script running anything between 2 and 12 concurrent randomly running 'ceph mon {add,remove}' with a mix of same mon.id/port, different mon.id/same port, same mon.id/different port, different mon.id/different port, and it held.

Comment thread src/mon/MonmapMonitor.cc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems a bit racy. What happens if multiple processes try and use the same name at once?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point, and I need to update the comment just above to reflect any similar doubts that may arise from this.

There's no risk of that actually happening. We don't collate proposals on the MonmapMonitor. Once we return 'true' below, PaxosService::dispatch() will check if we should propose and we will -- because we should always propose in this service (MonmapMonitor::should_propose() returns 0.0 delay). Even if Paxos does not propose right away because reasons, PaxosService::propose_pending() will nonetheless set proposing = true and we will not dispatch any further messages that may write -- including the one that would contain the offending data you mention.

In essence we are serializing write requests on the MonmapMonitor, and that's why doing this will be safe for as long as we maintain this behavior.

@liewegas

liewegas commented Jan 1, 2016

Copy link
Copy Markdown
Member

passed a run through rados suite

@liewegas

liewegas commented Jan 1, 2016

Copy link
Copy Markdown
Member

is this ready to merge?

@jecluis

jecluis commented Jan 4, 2016

Copy link
Copy Markdown
Member Author

as soon as squash and repush the updated comment I promised above. I'll merge it myself as soon as it's done.

During prepare_command(), we were returning to the user based on
pending_map's state. Even though this weren't causing any issues we are
aware of, we really shouldn't do that.

Signed-off-by: Joao Eduardo Luis <[email protected]>
jecluis added a commit that referenced this pull request Jan 4, 2016
mon: MonmapMonitor: don't expose uncommitted state to client

Reviewed-by: Sage Weil <[email protected]>
Reviewed-by: Greg Farnum <[email protected]>
@jecluis
jecluis merged commit 24c1abc into ceph:master Jan 4, 2016
@jecluis
jecluis deleted the wip-monmapmon branch January 4, 2016 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants