Commit Graph

19513 Commits

Author SHA1 Message Date
Sage Weil
3f637b8133 mon: show quorum names in health warning
Names, not just ranks (which nobody cares about).

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 17:26:43 -07:00
Sage Weil
ece33e5bb5 monmaptool: add --generate, --filter-initial options
Generate a monmap from conf/args, and apply the mon initial hosts to it.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:59 -07:00
Sage Weil
1473ef43bc monmap: move build_initial() from MonClient
This belongs here, not in MonClient.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
a68c224ac0 mon: move initial_members filtering into MonMap method
This is cleaner.  Also, we can perform/test this functionality from the
monmaptool.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
3c771924b5 mon: always mark seed/mkfs monmap as epoch 0
This isn't strictly necessary, since the MonmapMonitor resets this on first
commit, but it's cleaner.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
777b739b10 qa: add mon test for seeding bootstrap mon peers via admin socket
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
3920ce308a mon: add -or- update blank mon addr with join command
Update blank addrs with the join command (in addition to adding new mons).

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
434c158fa6 mon: send join message if we are in monmap with blank addr
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>
2012-05-18 16:23:58 -07:00
Sage Weil
6551298fe1 mon: simplify/clean up dummy addrs used for initial members
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>
2012-05-18 16:23:58 -07:00
Sage Weil
dfac925057 mon: learn peer addrs when probing
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>
2012-05-18 16:23:58 -07:00
Sage Weil
a5eba5251e mon: set our addr when populating monmap with initial members
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>
2012-05-18 16:23:58 -07:00
Sage Weil
fc447bd42a mon: add peers probing us to extra peer list
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>
2012-05-18 16:23:58 -07:00
Sage Weil
b5bec554b2 mon: 'add_bootstrap_peer_hint <addr>' via admin socket
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>
2012-05-18 16:23:58 -07:00
Sage Weil
824122d7bb mon: all starting with empty monmap
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>
2012-05-18 16:23:58 -07:00
Sage Weil
aa1ee9be7a cephtool: multiword admin socket commands
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>
2012-05-18 16:23:58 -07:00
Sage Weil
359fc7bbde admin_socket: match first word against command
This lets us do commands that take arguments.  We assume space is the
separator.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:58 -07:00
Sage Weil
262d5e2f31 monmap: move monmap generation from ip/host list into MonMap
Also generalize the prefix so it's explicit in the caller and a bit less
magic.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:57 -07:00
Sage Weil
b67bc0bc4b mon: drop mon_initial_hosts
Bad idea.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:57 -07:00
Sage Weil
59ccf9cea8 mon: clean up initial_members code slightly
Don't recalc rank unless we need to.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:57 -07:00
Sage Weil
0b74b8f6a6 qa: add a bunch of mon bootstrap tests
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>
2012-05-18 16:23:57 -07:00
Sage Weil
cba3ca7b8d mon: ignore election messages from outside monmap
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>
2012-05-18 16:23:57 -07:00
Sage Weil
6c8214fbc3 mon: include quorum member names in 'mon stat'
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:57 -07:00
Sage Weil
dc9122cb82 mon: limit initial quorum to mon_initial_members
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>
2012-05-18 16:23:57 -07:00
Sage Weil
585adcf1a6 mon: only include monmap mon's in outside_quorum, new quorum
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>
2012-05-18 16:23:56 -07:00
Sage Weil
e1d34cc4ac mon: add set of additional peers to probe
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>
2012-05-18 16:23:56 -07:00
Sage Weil
c7ba9feabe mon: use current monmap for initial quorum
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>
2012-05-18 16:23:56 -07:00
Sage Weil
0088699f7a mon: take probed peer's monmap if it has ever joined a quorum
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>
2012-05-18 16:23:56 -07:00
Sage Weil
c52a4f723f monmaptool: don't increment epoch on modification
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>
2012-05-18 16:23:56 -07:00
Sage Weil
5b18665759 mon: pass has_ever_joined in probe messages
This will allow monitors to behave appropriately with that important info..

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:23:55 -07:00
Sage Weil
e52093c5e1 mon: clean up "joined" flag
- 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>
2012-05-18 16:23:55 -07:00
Sage Weil
e197e79dc7 mon: add initial quorum config options
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 16:21:38 -07:00
Sage Weil
7e6be86785 mon: discover peer names during probe
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>
2012-05-18 16:21:38 -07:00
Sage Weil
52c284567d monclient: name resolved mon hosts noname-* too
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>
2012-05-18 16:21:37 -07:00
Sage Weil
2b5ee3e00d mon: include health in status
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 15:07:29 -07:00
Sage Weil
7d6facc03d mon: move health check into helper function
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 14:08:11 -07:00
Sage Weil
09978a8ab2 Merge remote-tracking branch 'gh/wip-mon-refactor'
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-05-18 13:54:05 -07:00
Joao Eduardo Luis
d599eded54 mon: fix a bug that was preventing us from subscribing to some log levels.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-05-18 12:07:45 -07:00
Joao Eduardo Luis
20df432473 mon: fix the priority filter.
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>
2012-05-18 11:32:43 -07:00
Sage Weil
9fb3cd281d ceph-authtool: fix clitests
No more --bin option.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 10:59:52 -07:00
Sage Weil
4832c46eab ceph-authtool: fix usage
No more -b, --bin.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 10:59:28 -07:00
Sage Weil
b180ac25aa Merge branch 'wip-mon-keyring'
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-05-17 20:29:42 -07:00
Sage Weil
9125e908a5 mon: monmap first from 'status' command
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:34 -07:00
Sage Weil
9a1d757bc8 mon: only log map state changes from primary
We still get noise after elections, but only from the winner.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:34 -07:00
Sage Weil
78d0d0976b cephtool: aesthetic change to ceph -w output
* no seq
* name, not ip addr

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Sage Weil
13a9a15248 mon: aesthetic changes to map change log entries
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Sage Weil
6b76ac3a3c Makefile: drop MMonObserve*
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Sage Weil
89316566b5 remove gceph
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Sage Weil
a586bdf081 ceph.spec: don't package gceph
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Sage Weil
f943f34b83 debian: don't package gceph
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-17 20:23:33 -07:00
Joao Eduardo Luis
035bb125a7 src: get rid of the Observers throughout the code base.
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>
2012-05-17 16:15:25 -07:00