Project

General

Profile

Bug #5896

mon: MonmapMonitor: 'ceph mon add' always returns 'mon already exists'

Added by Joao Eduardo Luis over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
High
Assignee:
Joao Eduardo Luis
Category:
Monitor
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

on next (ceph version 0.67-rc3-100-ge8d72ef (e8d72ef0402a42c8aa8ea624497d13db81d5e361))

$ ceph mon dump
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
dumped monmap epoch 9
epoch 9
fsid d8b53103-f50e-4fed-84e9-c95f30b5b441
last_changed 2013-08-06 17:56:49.452341
created 2013-08-05 19:24:54.662265
0: 127.0.0.1:6789/0 mon.a
1: 127.0.0.1:6790/0 mon.b
2: 127.0.0.1:6791/0 mon.c

$ ceph mon add foo 127.0.0.1:6795
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
Error EEXIST: mon foo 127.0.0.1:6795/0 already exists

What the bug is:

- MonmapMonitor::handle_command() will add update the pending inc with the new mon, and queue the reply to the client on wait_for_finished_proposal().
- Monitor bootstraps due to updated monmap before waking up waiters on waiting_for_finished_proposal.
- all waiters on waiting_for_finished_proposal are retried with EAGAIN
Command is retried instead of replying to the client -> monitor already exists.

Associated revisions

Revision dce3d26d (diff)
Added by Joao Eduardo Luis over 10 years ago

mon: MonmapMonitor: make 'ceph mon add' idempotent

MonMap changes lead to bootstraps. Callbacks waiting for a proposal to
finish can have several fates, depending on what happens: finished, rerun
or aborted.

In the case of a bootstrap right after a monmap change, callbacks are
rerun. Considering we queued the message that lead to the monmap change
on this queue, if we instead of finishing it end up reruning it, we will
end up trying to perform the same modification twice -- the last one will
try to modify an already existing state and we will return just that:
whatever you're attempting to do has already been done.

This patch makes 'ceph mon add' completely idempotent. If one tries to
add an already existing monitor (i.e., same name, same ip:port), one
simply gets a 'monitor foo added', with return 0, no matter how many
times one runs the command.

Fixes: #5896

Signed-off-by: Joao Eduardo Luis <>

History

#1 Updated by Joao Eduardo Luis over 10 years ago

  • Description updated (diff)

#2 Updated by Sage Weil over 10 years ago

  • Priority changed from Normal to High

#3 Updated by Joao Eduardo Luis over 10 years ago

I thought I had fixed this. I'll check.

#4 Updated by Joao Eduardo Luis over 10 years ago

  • Status changed from New to Fix Under Review

wip-5896, pull request 557

#5 Updated by Sage Weil over 10 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF