Being in the monmap with a blank ip is possible if we were a initial member
seed but weren't part of the first election/quorum. If that's the case,
first update ourselves before we try to call an election and join the
quorum.
Signed-off-by: Sage Weil <sage@inktank.com>
Use a complete blank IP, but set the nonce. This way
entity_addr_t::is_blank_ip() works. We're also outside of the namespace of
possible addrs that the mons *could* use, which is a bit cleaner.
Signed-off-by: Sage Weil <sage@inktank.com>
If we have a monmap with dummy addrs for initial members, and we probe one
of those peers and learn their address, update our monmap appropriately.
Signed-off-by: Sage Weil <sage@inktank.com>
If the seed monmap doesn't contain us and we are populating it with
initial members, and one of those members is us, use our addr instead of
using a dummy one.
Signed-off-by: Sage Weil <sage@inktank.com>
If we are probed by another monitor, add them to our extra probe list. This
lets us rely on the active probe/reply to gather information and not infer
anything from here.
Signed-off-by: Sage Weil <sage@inktank.com>
Let user add peer hints via the admin socket while bootstrapping. Once we
have joined a cluster this command is ignored.
Signed-off-by: Sage Weil <sage@inktank.com>
It's okay to start up with an empty monmap. It just means that you must:
* set 'mon initial members'
* feed hints via the admin socket, or learn hints from other mons probing
us
Signed-off-by: Sage Weil <sage@inktank.com>
Slurp up anything on the command line that isn't an option, so that you can
do
ceph --admin-socket /path/to/asok foo bar baz
instead of
ceph --admin-socket /path/to/asok 'foo bar baz'
Signed-off-by: Sage Weil <sage@inktank.com>
These's are comprehensive because a lot of the startup logic is about
picking a local address, and it's difficult to do test that on a single
host. They cover the other variables surrounding mon bringing up, though:
- part of initial monmap, or not
- new nodes given all prior nodes, or not
- new nodes have self included in monmap seed, or not
- initial quorum members
Signed-off-by: Sage Weil <sage@inktank.com>
These shouldn't(tm) happen with new code, but with old code they do. And
if we get them, elector can try to monmap->get_inst() on them and crash.
Throw them out here; they're nonsense from our perspective anyway if the
peer isn't part of our monmap.
Signed-off-by: Sage Weil <sage@inktank.com>
This is a two-stage process.
* If we start up, and have never joined a quorum, and initial members are
specified, only include them in the monmap; put all others in the
extra probe list.
* We add missing members if necessary to make the monmap (and initial
quorum) the right size.
* If we probe someone that *has* participated in a successful quorum, we
get their monmap, and restart, so this is moot.
* We only call an election to create a new cluster if outside_quorum gets
big enough (it will only include initial members) and if it includes us.
Signed-off-by: Sage Weil <sage@inktank.com>
Only include mons that are in the monmap in the outside_quorum set, which
we use to determine if we can form a new quorum.
In particular, if we ourselves are not in the monmap, we can't call an
election (that wouldn't include us anyway).
Signed-off-by: Sage Weil <sage@inktank.com>
Probe an additional set of peers, not included in the monmap.
Incomplete; we'll still assume they *can* form a quorum. See next patch.
Signed-off-by: Sage Weil <sage@inktank.com>
This makes a bit more sense. Don't use the seed monmap, but use the one
we ended up with when we formed our first quorum. This will do a better
job of picking up names of peers, and also ensure we get a map based on
the mon initial members (if specified).
Signed-off-by: Sage Weil <sage@inktank.com>
If we probe a peer and their monmap has actually been part of a started
cluster/quorum, and ours hasn't, take theirs. Comparing versions isn't
sufficient.
Signed-off-by: Sage Weil <sage@inktank.com>
This just confuses things, because a manually manipulated map might have
some epoch number that bears no relation to the actual published/committed
maps.
Signed-off-by: Sage Weil <sage@inktank.com>
- check flag on init, keep in memory
- set flag only when we are active and have a committed monmap. i.e., when
we are active participants in a bootstrapped/created mon cluster.
Signed-off-by: Sage Weil <sage@inktank.com>
Fill in noname- entires in initial generate monmap (e.g., from mon_host)
with real peer names as we discover them.
This will make the upcoming initial quorum config check work by letting us
identify peers by name.
Signed-off-by: Sage Weil <sage@inktank.com>
This would allow you to do
mon host = foo, bar, baz
or
mon host = multiarecordhostname.foo.com
and have the generated monmap tag monitors as noname-, so that the ceph-mon
mkfs will identify itself as one of them and initialize itself
properly.
Signed-off-by: Sage Weil <sage@newdream.net>
When a given log level L was specified, we would reply with all the
messages of "level L and below"; for instance, for a 'log-error' we would
present all the messages of level 'error', 'warn', 'sec', 'info' and
'debug'.
We shouldn't be doing it that way, so we just inverted the filter
condition. Now we show only 'L and above'; i.e., for a log level of
'log-warn', show only 'log-warn' and 'log-error'.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
This is a little weak, since it doesn't fill in the Connection's data
when we initially create the new Pipe. But doing that would require
passing more state around that mucks up the interfaces a bit, so I
don't think it's worthwhile. This also makes it clear that this
set of functions is not responsible for doing things like reset
notifications -- those need to be handled through the normal channels
(I reviewed them and as best I can tell, they are.)
Signed-off-by: Greg Farnum <greg@inktank.com>
This is a big patch that will remove all references to the observers
throughout the code, including a complete removal of the Observer-related
messages' source files.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
We reworked the code a bit to accommodate the introduction for the log
monitor's publish/subscribe mechanisms. With this patch we no longer
depend on the observer's, and use instead the much broader approach of
subscribing to events. In our case, we will subscribe to log levels.
If the '-w'/'--watch' flag is defined, the tool will be subscribed to the
'log-info' level by default, unless one of the following flags are defined
(in which case the level will be changed accordingly): '--watch-debug',
'--watch-info', '--watch-sec', '--watch-warn' and '--watch-error'.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>