Commit Graph

19576 Commits

Author SHA1 Message Date
Yehuda Sadeh
c7daf7a44c crush: check malloc results
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
2012-05-20 15:12:27 -07:00
Sage Weil
5b39ae7e49 osdmap: set name_pool correctly in build_simple*()
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-20 14:12:16 -07:00
Sage Weil
033be2b9f0 osdmap: use pg[p]_num accessors
This lets us ensure that calc_pg_masks() is called when pg[p]_num is set or
modified.

Fixes: #2448
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-20 14:12:10 -07:00
Sage Weil
deccc592c5 filestore: do not test xattrs on fsid file
This is sufficient to break our fcntl lock, which breaks the check for
other running daemons.

Broken by f03dc34f7e

Fixes: #2452
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-20 14:12:02 -07:00
Sage Weil
bd5fc0a0d4 debian: fix ceph-kdump-copy.init
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-20 14:11:54 -07:00
Sage Weil
31102d317d debian: fix ceph-kdump-copy.init
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-20 12:50:09 -07:00
Sage Weil
3f38605d19 filestore: test xattrs on temporary file
There isn't one we can rely on existing yet.  Broken by
1314a00798 while fixing #2452.

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 16:12:58 -07:00
Sage Weil
34e8169ed6 monmaptool: fix clitests
- epoch is always 0
- new options in usage string

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 15:08:26 -07:00
Sage Weil
1314a00798 filestore: do not test xattrs on fsid file
This is sufficient to break our fcntl lock, which breaks the check for
other running daemons.

Broken by f03dc34f7e

Fixes: #2452
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 14:56:49 -07:00
Sage Weil
44fe8c8213 osdmap: set name_pool correctly in build_simple*()
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 13:24:50 -07:00
Sage Weil
ba2488f238 osdmap: use pg[p]_num accessors
This lets us ensure that calc_pg_masks() is called when pg[p]_num is set or
modified.

Fixes: #2448
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 13:24:47 -07:00
Sage Weil
69e823e586 cephtool: restore osdmap handler
Accidentally removed by 841372494f.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-19 09:44:00 -07:00
Sage Weil
360930a075 qa: use full paths for mon bootstrap tests
Signed-off-by: Sage Weil <sage@inktank.com>
2012-05-18 17:26:43 -07:00
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