]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
13 years agomon: allow health, status, log, etc. messages with 'r' cap
Sage Weil [Wed, 23 May 2012 01:17:37 +0000 (18:17 -0700)]
mon: allow health, status, log, etc. messages with 'r' cap

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: fix error messages
Sage Weil [Wed, 23 May 2012 01:17:17 +0000 (18:17 -0700)]
mon: fix error messages

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: push down 'auth ...' command auth checks
Sage Weil [Wed, 23 May 2012 00:59:22 +0000 (17:59 -0700)]
mon: push down 'auth ...' command auth checks

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: push down command auth checks to each command
Sage Weil [Wed, 23 May 2012 00:53:27 +0000 (17:53 -0700)]
mon: push down command auth checks to each command

Everything except 'fsid', which I figure is truly public information?

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: require admin privs to issue any monitor commands
Sage Weil [Wed, 23 May 2012 00:34:55 +0000 (17:34 -0700)]
mon: require admin privs to issue any monitor commands

This is overkill, but a first step before pushing caps enforcement down
into each subfunction that processes monitor commands.

Fixes: #2443
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agovstart.sh: set HOSTNAME when -l is used
Sage Weil [Wed, 23 May 2012 01:17:48 +0000 (18:17 -0700)]
vstart.sh: set HOSTNAME when -l is used

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: fix 'get-or-create-key'
Sage Weil [Wed, 23 May 2012 01:00:49 +0000 (18:00 -0700)]
mon: fix 'get-or-create-key'

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge branch 'wip-quorum'
Sage Weil [Wed, 23 May 2012 00:13:28 +0000 (17:13 -0700)]
Merge branch 'wip-quorum'

13 years agodoc/config-cluster/chef.rst <-fixed an error in upload command.
John Wilkins [Wed, 23 May 2012 00:10:43 +0000 (17:10 -0700)]
doc/config-cluster/chef.rst <-fixed an error in upload command.
doc/config-cluster/deploying-ceph-conf.rst <-added sudo. required.
doc/config-cluster/deploying-ceph-with-mkcephfs.rst <-cd to /etc/ceph so keyring goes there.
doc/install/chef.rst <-added update and install opscode-keyring, and upgrade.
doc/install/debian.rst <-added ceph-common to the install

Signed-off-by: John Wilkins <john.wilkins@dreamhost.com>
13 years agoMerge branch 'stable'
Josh Durgin [Tue, 22 May 2012 19:54:09 +0000 (12:54 -0700)]
Merge branch 'stable'

13 years agoobjectcacher: fix infinite loop in flusher_entry
Sage Weil [Tue, 22 May 2012 00:18:35 +0000 (17:18 -0700)]
objectcacher: fix infinite loop in flusher_entry

The addition of accounting for simultaneous writers in
f3043fee3e22600cb4349072287842db129588eb could lead to an infinite
loop. This could happen because starting a flush doesn't decrease
dirty_waiters, only the number of dirty bytes (they change to tx). If
dirty_waiters is more than target_dirty, the loop would continue
forever while holding the object cacher lock, since the object cacher
lock is required by the write callbacks.

The extra while (!flusher_stop) loop is unnecessary, so remove it.
This means the flusher thread always releases the lock after starting
flushing, so progress can be made.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoMerge branch 'master' of github.com:ceph/ceph
John Wilkins [Tue, 22 May 2012 16:54:06 +0000 (09:54 -0700)]
Merge branch 'master' of github.com:ceph/ceph

13 years agodoc/config-cluster/ceph-conf.rst <-Fixed some formatting issues.
John Wilkins [Tue, 22 May 2012 16:53:34 +0000 (09:53 -0700)]
doc/config-cluster/ceph-conf.rst <-Fixed some formatting issues.
doc/config-cluster/deploying-ceph-conf.rst <-minor edit.
doc/start/get-involved-in-the-ceph-community.rst <-removed $ from command line instruction.
doc/start/quick-start.rst <-added additional steps.

Signed-off-by: John Wilkins <john.wilkins@dreamhost.com>
13 years agomonmap: calc_ranks() on rename()
Sage Weil [Tue, 22 May 2012 14:05:36 +0000 (07:05 -0700)]
monmap: calc_ranks() on rename()

This is simpler than ensuring we track all the right invariants.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge branch 'wip-defensive-alloc'
Sage Weil [Tue, 22 May 2012 03:01:03 +0000 (20:01 -0700)]
Merge branch 'wip-defensive-alloc'

13 years agocrush: check reweight return value
Sage Weil [Tue, 22 May 2012 03:00:51 +0000 (20:00 -0700)]
crush: check reweight return value

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agodoc: fix broken link in FAQ
Ross Turk [Tue, 22 May 2012 02:36:59 +0000 (19:36 -0700)]
doc: fix broken link in FAQ

Signed-off-by: Ross Turk <ross@inktank.com>
13 years agodoc: added links from the chef install doc to the chef config doc and back
Ross Turk [Tue, 22 May 2012 01:22:35 +0000 (18:22 -0700)]
doc: added links from the chef install doc to the chef config doc and back

Signed-off-by: Ross Turk <ross@inktank.com>
13 years agodoc: Added a FAQ page.
Ross Turk [Tue, 22 May 2012 01:21:39 +0000 (18:21 -0700)]
doc: Added a FAQ page.

Added a FAQ page, which we will need to put more content in.

Signed-off-by: Ross Turk <ross@inktank.com>
13 years agoAdded the Swift API as is. Still needs a lot of work.
John Wilkins [Tue, 22 May 2012 00:49:35 +0000 (17:49 -0700)]
Added the Swift API as is. Still needs a lot of work.

Signed-off-by: John Wilkins <john.wilkins@dreamhost.com>
13 years agodoc: document range of methods for cluster creation, expansion
Sage Weil [Mon, 21 May 2012 23:57:26 +0000 (16:57 -0700)]
doc: document range of methods for cluster creation, expansion

This isn't quite complete, and should be integrated with the info in the
ops section on mon cluster expansion, but the raw content is here at least.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agodoc: misc updates
John Wilkins [Fri, 18 May 2012 20:54:51 +0000 (13:54 -0700)]
doc: misc updates

doc/architecture.rst - removed broken reference.
doc/config-cluster - cleanup and added chef
doc/install - Made generic to add Chef, OpenStack and libvert installs
doc/init - Created light start | stop and health section
doc/source - Removed $ from code examples. Trimmed paras to 80 char
doc/images - Added preliminary diagram for Chef.
doc/rec - Added reference to hardware. Added filesystem info.

Signed-off-by: John Wilkins <john.wilkins@dreamhost.com>
13 years agomon: fix 'no initial monitors' warning
Sage Weil [Mon, 21 May 2012 22:07:42 +0000 (15:07 -0700)]
mon: fix 'no initial monitors' warning

It is valid to start with no initial monitors even when the initial set is
not defined; it just means that we are only able to join a cluster, and
never able to form a new one.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agolibs3: remove make install target
Yehuda Sadeh [Mon, 21 May 2012 21:32:22 +0000 (14:32 -0700)]
libs3: remove make install target

13 years agov0.47.1 v0.47.1
Sage Weil [Mon, 21 May 2012 21:28:45 +0000 (14:28 -0700)]
v0.47.1

13 years agoMakefile.am: only append libs3 to SUBDIRS when needed
Yehuda Sadeh [Mon, 21 May 2012 21:20:24 +0000 (14:20 -0700)]
Makefile.am: only append libs3 to SUBDIRS when needed

We appended libs3 to SUBDIRS unconditionally, we only need that
when we actually want to compile it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agofilestore: test xattrs on temporary file
Sage Weil [Sat, 19 May 2012 23:03:41 +0000 (16:03 -0700)]
filestore: test xattrs on temporary file

There isn't one we can rely on existing yet.  Broken by
1314a00798ed4b7ef2f2686f0195c5c53c98c2ce while fixing #2452.

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoceph-object-corpus: add some old v2 monmaps
Sage Weil [Mon, 21 May 2012 21:20:38 +0000 (14:20 -0700)]
ceph-object-corpus: add some old v2 monmaps

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomonmap: fix decoding of old monmaps
Sage Weil [Mon, 21 May 2012 20:58:55 +0000 (13:58 -0700)]
monmap: fix decoding of old monmaps

The old monmaps had a u16 for the version.  Fix our decode.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoqa: fix mon single_host_multi.sh test
Sage Weil [Mon, 21 May 2012 20:15:23 +0000 (13:15 -0700)]
qa: fix mon single_host_multi.sh test

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: rename ourselves if our name does not match committed monmap
Sage Weil [Mon, 21 May 2012 20:15:11 +0000 (13:15 -0700)]
mon: rename ourselves if our name does not match committed monmap

If we are part of the quorum but our name does not match, fix it.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: only rename peers in seed monmap
Sage Weil [Mon, 21 May 2012 20:14:50 +0000 (13:14 -0700)]
mon: only rename peers in seed monmap

Once we have a committed monmap, stop renaming peers.  This only gets us
confused because our monmap does not match the paxos committed one.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: move election msg check into elector
Sage Weil [Mon, 21 May 2012 20:07:16 +0000 (13:07 -0700)]
mon: move election msg check into elector

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: allow mons to rename themselves with the join message
Sage Weil [Mon, 21 May 2012 20:01:49 +0000 (13:01 -0700)]
mon: allow mons to rename themselves with the join message

This allows mons that got stuck in the initial quorum's monmap as noname-*
to fix their name before joining in.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomonmap: fix rename
Sage Weil [Mon, 21 May 2012 20:00:59 +0000 (13:00 -0700)]
monmap: fix rename

Update addr_name map appropriately.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: drop useless rank racalc in init
Sage Weil [Mon, 21 May 2012 18:46:06 +0000 (11:46 -0700)]
mon: drop useless rank racalc in init

bootstrap() handles this, no need to worry about it here.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: fix leak of MonMap
Sage Weil [Mon, 21 May 2012 18:38:07 +0000 (11:38 -0700)]
mon: fix leak of MonMap

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomonmap: filter_initial_members -> set_initial_members
Sage Weil [Mon, 21 May 2012 18:36:43 +0000 (11:36 -0700)]
monmap: filter_initial_members -> set_initial_members

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoUpdate leveldb to remove CompactionInputErrorParanoid
Samuel Just [Mon, 21 May 2012 17:39:44 +0000 (10:39 -0700)]
Update leveldb to remove CompactionInputErrorParanoid

CompactionInputErrorParanoid tends not to complete in time during
gitbuilder runs resulting in false failures.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoman: Remove leftover --bin from ceph-authtool(8).
Tommi Virtanen [Mon, 21 May 2012 15:52:49 +0000 (08:52 -0700)]
man: Remove leftover --bin from ceph-authtool(8).

Regenerate manpage.

See 4832c46eab55b1f2cbe9aca419124c2c9d645889,
ec732816ef04e036db338cdbe5cdfb9a1b649f8e for the actual removal of the
feature.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agoMerge branch 'stable'
Sage Weil [Mon, 21 May 2012 04:18:36 +0000 (21:18 -0700)]
Merge branch 'stable'

Conflicts:
src/os/FileStore.cc

13 years agov0.47 v0.47
Sage Weil [Sun, 20 May 2012 22:16:30 +0000 (15:16 -0700)]
v0.47

13 years agokeys: new release key
Sage Weil [Sun, 20 May 2012 22:32:19 +0000 (15:32 -0700)]
keys: new release key

New release key for signing packages.  Signed by me (the old release key)
so that existing apt keyrings should be sufficient.  New keyrings should
just add the new release key.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agobuilder: make reweight helpers static, void
Sage Weil [Sun, 20 May 2012 22:11:21 +0000 (15:11 -0700)]
builder: make reweight helpers static, void

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoformatter: replace malloc with new
Yehuda Sadeh [Sun, 20 May 2012 22:08:20 +0000 (15:08 -0700)]
formatter: replace malloc with new

This will throw exception if allocation failed.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
13 years agocheck malloc return values
Yehuda Sadeh [Sun, 20 May 2012 22:07:57 +0000 (15:07 -0700)]
check malloc return values

There were a few places where we didn't check malloc return code.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
13 years agocrush: check malloc results
Yehuda Sadeh [Sun, 20 May 2012 22:09:08 +0000 (15:09 -0700)]
crush: check malloc results

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
13 years agoosdmap: set name_pool correctly in build_simple*()
Sage Weil [Sat, 19 May 2012 20:24:35 +0000 (13:24 -0700)]
osdmap: set name_pool correctly in build_simple*()

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosdmap: use pg[p]_num accessors
Sage Weil [Sat, 19 May 2012 20:24:47 +0000 (13:24 -0700)]
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>
13 years agofilestore: do not test xattrs on fsid file
Sage Weil [Sat, 19 May 2012 21:56:49 +0000 (14:56 -0700)]
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 f03dc34f7e2fc1707fa00339b917c0d2c93dbdd3

Fixes: #2452
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agodebian: fix ceph-kdump-copy.init
Sage Weil [Sun, 20 May 2012 19:49:48 +0000 (12:49 -0700)]
debian: fix ceph-kdump-copy.init

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agodebian: fix ceph-kdump-copy.init
Sage Weil [Sun, 20 May 2012 19:49:48 +0000 (12:49 -0700)]
debian: fix ceph-kdump-copy.init

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agofilestore: test xattrs on temporary file
Sage Weil [Sat, 19 May 2012 23:03:41 +0000 (16:03 -0700)]
filestore: test xattrs on temporary file

There isn't one we can rely on existing yet.  Broken by
1314a00798ed4b7ef2f2686f0195c5c53c98c2ce while fixing #2452.

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomonmaptool: fix clitests
Sage Weil [Sat, 19 May 2012 22:08:26 +0000 (15:08 -0700)]
monmaptool: fix clitests

- epoch is always 0
- new options in usage string

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agofilestore: do not test xattrs on fsid file
Sage Weil [Sat, 19 May 2012 21:56:49 +0000 (14:56 -0700)]
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 f03dc34f7e2fc1707fa00339b917c0d2c93dbdd3

Fixes: #2452
Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosdmap: set name_pool correctly in build_simple*()
Sage Weil [Sat, 19 May 2012 20:24:35 +0000 (13:24 -0700)]
osdmap: set name_pool correctly in build_simple*()

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosdmap: use pg[p]_num accessors
Sage Weil [Sat, 19 May 2012 20:24:47 +0000 (13:24 -0700)]
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>
13 years agocephtool: restore osdmap handler
Sage Weil [Sat, 19 May 2012 16:44:00 +0000 (09:44 -0700)]
cephtool: restore osdmap handler

Accidentally removed by 841372494f531c7481cf3eff1b673cedbab4d60d.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoqa: use full paths for mon bootstrap tests
Sage Weil [Sat, 19 May 2012 00:12:17 +0000 (17:12 -0700)]
qa: use full paths for mon bootstrap tests

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: show quorum names in health warning
Sage Weil [Sat, 19 May 2012 00:12:35 +0000 (17:12 -0700)]
mon: show quorum names in health warning

Names, not just ranks (which nobody cares about).

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomonmaptool: add --generate, --filter-initial options
Sage Weil [Fri, 18 May 2012 17:52:04 +0000 (10:52 -0700)]
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>
13 years agomonmap: move build_initial() from MonClient
Sage Weil [Fri, 18 May 2012 17:38:26 +0000 (10:38 -0700)]
monmap: move build_initial() from MonClient

This belongs here, not in MonClient.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: move initial_members filtering into MonMap method
Sage Weil [Fri, 18 May 2012 16:52:09 +0000 (09:52 -0700)]
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>
13 years agomon: always mark seed/mkfs monmap as epoch 0
Sage Weil [Fri, 18 May 2012 16:38:52 +0000 (09:38 -0700)]
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>
13 years agoqa: add mon test for seeding bootstrap mon peers via admin socket
Sage Weil [Fri, 18 May 2012 01:18:10 +0000 (18:18 -0700)]
qa: add mon test for seeding bootstrap mon peers via admin socket

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: add -or- update blank mon addr with join command
Sage Weil [Fri, 18 May 2012 01:14:33 +0000 (18:14 -0700)]
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>
13 years agomon: send join message if we are in monmap with blank addr
Sage Weil [Fri, 18 May 2012 01:13:57 +0000 (18:13 -0700)]
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>
13 years agomon: simplify/clean up dummy addrs used for initial members
Sage Weil [Fri, 18 May 2012 01:17:18 +0000 (18:17 -0700)]
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>
13 years agomon: learn peer addrs when probing
Sage Weil [Fri, 18 May 2012 00:52:54 +0000 (17:52 -0700)]
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>
13 years agomon: set our addr when populating monmap with initial members
Sage Weil [Fri, 18 May 2012 00:51:47 +0000 (17:51 -0700)]
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>
13 years agomon: add peers probing us to extra peer list
Sage Weil [Fri, 18 May 2012 00:50:49 +0000 (17:50 -0700)]
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>
13 years agomon: 'add_bootstrap_peer_hint <addr>' via admin socket
Sage Weil [Fri, 18 May 2012 00:50:01 +0000 (17:50 -0700)]
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>
13 years agomon: all starting with empty monmap
Sage Weil [Fri, 18 May 2012 00:49:00 +0000 (17:49 -0700)]
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>
13 years agocephtool: multiword admin socket commands
Sage Weil [Fri, 18 May 2012 00:30:35 +0000 (17:30 -0700)]
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>
13 years agoadmin_socket: match first word against command
Sage Weil [Fri, 18 May 2012 00:15:41 +0000 (17:15 -0700)]
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>
13 years agomonmap: move monmap generation from ip/host list into MonMap
Sage Weil [Thu, 17 May 2012 22:12:23 +0000 (15:12 -0700)]
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>
13 years agomon: drop mon_initial_hosts
Sage Weil [Thu, 17 May 2012 22:11:39 +0000 (15:11 -0700)]
mon: drop mon_initial_hosts

Bad idea.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: clean up initial_members code slightly
Sage Weil [Thu, 17 May 2012 22:38:45 +0000 (15:38 -0700)]
mon: clean up initial_members code slightly

Don't recalc rank unless we need to.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoqa: add a bunch of mon bootstrap tests
Sage Weil [Thu, 17 May 2012 21:50:31 +0000 (14:50 -0700)]
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>
13 years agomon: ignore election messages from outside monmap
Sage Weil [Thu, 17 May 2012 21:46:46 +0000 (14:46 -0700)]
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>
13 years agomon: include quorum member names in 'mon stat'
Sage Weil [Thu, 17 May 2012 20:27:47 +0000 (13:27 -0700)]
mon: include quorum member names in 'mon stat'

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: limit initial quorum to mon_initial_members
Sage Weil [Thu, 17 May 2012 20:27:30 +0000 (13:27 -0700)]
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>
13 years agomon: only include monmap mon's in outside_quorum, new quorum
Sage Weil [Thu, 17 May 2012 19:39:11 +0000 (12:39 -0700)]
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>
13 years agomon: add set of additional peers to probe
Sage Weil [Thu, 17 May 2012 19:37:36 +0000 (12:37 -0700)]
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>
13 years agomon: use current monmap for initial quorum
Sage Weil [Thu, 17 May 2012 19:36:41 +0000 (12:36 -0700)]
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>
13 years agomon: take probed peer's monmap if it has ever joined a quorum
Sage Weil [Thu, 17 May 2012 18:08:38 +0000 (11:08 -0700)]
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>
13 years agomonmaptool: don't increment epoch on modification
Sage Weil [Thu, 17 May 2012 18:09:24 +0000 (11:09 -0700)]
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>
13 years agomon: pass has_ever_joined in probe messages
Sage Weil [Thu, 17 May 2012 18:07:45 +0000 (11:07 -0700)]
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>
13 years agomon: clean up "joined" flag
Sage Weil [Thu, 17 May 2012 18:00:46 +0000 (11:00 -0700)]
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>
13 years agomon: add initial quorum config options
Sage Weil [Thu, 17 May 2012 04:15:28 +0000 (21:15 -0700)]
mon: add initial quorum config options

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: discover peer names during probe
Sage Weil [Thu, 17 May 2012 04:09:58 +0000 (21:09 -0700)]
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>
13 years agomonclient: name resolved mon hosts noname-* too
Sage Weil [Tue, 1 May 2012 20:15:11 +0000 (13:15 -0700)]
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>
13 years agomon: include health in status
Sage Weil [Fri, 18 May 2012 22:07:29 +0000 (15:07 -0700)]
mon: include health in status

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: move health check into helper function
Sage Weil [Fri, 18 May 2012 21:08:11 +0000 (14:08 -0700)]
mon: move health check into helper function

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge remote-tracking branch 'gh/wip-mon-refactor'
Sage Weil [Fri, 18 May 2012 20:54:05 +0000 (13:54 -0700)]
Merge remote-tracking branch 'gh/wip-mon-refactor'

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
13 years agomon: fix a bug that was preventing us from subscribing to some log levels.
Joao Eduardo Luis [Fri, 18 May 2012 19:07:45 +0000 (12:07 -0700)]
mon: fix a bug that was preventing us from subscribing to some log levels.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
13 years agomon: fix the priority filter.
Joao Eduardo Luis [Fri, 18 May 2012 18:32:43 +0000 (11:32 -0700)]
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>
13 years agoceph-authtool: fix clitests
Sage Weil [Fri, 18 May 2012 17:59:52 +0000 (10:59 -0700)]
ceph-authtool: fix clitests

No more --bin option.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoceph-authtool: fix usage
Sage Weil [Fri, 18 May 2012 17:59:28 +0000 (10:59 -0700)]
ceph-authtool: fix usage

No more -b, --bin.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge branch 'wip-mon-keyring'
Sage Weil [Fri, 18 May 2012 03:29:42 +0000 (20:29 -0700)]
Merge branch 'wip-mon-keyring'

Reviewed-by: Greg Farnum <greg@inktank.com>