debian: Create placeholder dirs for mon and osd data directories.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
debian, upstart, osd: osd disk preparation and activation scripts

Signed-off-by: Tommi Virtanen <tv@inktank.com>
upstart: support mds

Closes: #2414
Signed-off-by: Tommi Virtanen <tv@inktank.com>
admin_socket: register command prefixes

Allow any command prefix to be registered, provided it is separated by a
space.  Previously, we always matched against the first word.

Signed-off-by: Sage Weil <sage@inktank.com>
admin_socket: streamline command set

 log flush
 log dump
 log reopen
 config show
 config set <var> <val>
 perf dump
 perf schema

Signed-off-by: Sage Weil <sage@inktank.com>
admin_socket: streamline 'version' commands

 version     -- ceph version
 git_version -- git sha1
 0           -- proto version (for backward compat)

Signed-off-by: Sage Weil <sage@inktank.com>
admin_socket: pass args separately

This avoids making the callback parse off the command portion on their own.
It also lets them assert that the command portion is in the set of
registered commands.

Signed-off-by: Sage Weil <sage@inktank.com>
admin_socket: fix unit test

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix admin socket lock dependency

Signed-off-by: Sage Weil <sage@inktank.com>
perf_counters: use bufferlist instead of vector<char>

bufferlist allocates page-sized chunks and avoids realloc, which'll be
more efficient than vector resize doubling just about always.

Signed-off-by: Sage Weil <sage@inktank.com>
Makefile: include ceph-mds upstart bits in dist tarball

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix slurp latest race

It is possible for the latest version to get out in front of the
last_committed version:

 a- start slurping
 a- slurp a bunch of states, through X
 a- get them back, write them out
 b- monitor commits many new states
 a- slurp latest, X+100 say, but only get some of those states due to the
    slurp per-message byte limit
 a- write latest + some (but not all) prior states
 a- call back into slurp(), update_from_paxos(), trigger assert

This fix ensures that we make note of the source's new latest, so that on
the next pass through slurp() we will grab any missing states.

We *also* explicitly require that we get everything up through what we have
stashed, in defense against some future kludging that might only require we
nearly (but not completely) in sync before finishing the slurp.

Fixes: #2379
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Merge remote-tracking branch 'gh/wip-admin'
objecter: fix pgls

First problem: if the osd returns more entries than we ask for, max_entries
was going negative, and we were requesting (u64)(-small number) on the
next iteration, slamming the OSD when the PG was big.  We fix that by
finishing response_size >= max_entries.

Second problem: AFAICS we were not requesting the second chunk on a large
PG at all, here, if the OSD returned less than what we wanted.  Fix this
by asking for more in that case.

That means we detect the end of a PG in two ways:

 * if the OSD sets the return value to 1 (instead of 0)
 * if we get 0 items in the response

Another patch will change the OSD behavior to return 1, and all will be
well.  If we run against an old OSD, we'll send an extra request for each
PG and get nothing back before we realize we've hit the end and move on.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
ReplicatedPG: fix pgls listing, add max listing size

Previously, a client requesting a large pgls could tie up the
osd for an unacceptable amount of time.  Also, it's possible
for the osd to return less than the requested number of
entries anyway, so we now return 1 when we have completed the
listing.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
omapbench: fix misc warnings

Signed-off-by: Sage Weil <sage@inktank.com>
omapbench: fix warning

Signed-off-by: Sage Weil <sage@inktank.com>
paxos: warn on extreme clock skew

This would have helped us diagnose #2480.

Signed-off-by: Sage Weil <sage@inktank.com>
upstart: simplify start; allow group stop via an abstract job

Use a 'ceph-mds' or 'ceph-mon' event to start instances instead of
explicitly calling start.  This avoids the ugly is-this-already-running
check.  [Thanks Guilhem Lettron for that!]

Make the -all job abstract (which means it stays started and can be
stopped).  Trigger a helper task (-all-starter) to trigger instance
start.  Make instances stop with the -all task.  This allows you to do

 start ceph-mds-all
 stop ceph-mds-all
 start ceph-mds id=foo
 start ceph-mds-all
 stop ceph-mds id=bar
 stop ceph-mds-all

but not

 start ceph-mds id=foo
 stop ceph-mds-all

because ceph-mds-all isn't running.  Not quite as flexible in sysvinit in
that regard, but good enough for me.

Fixes: #2414
Signed-off-by: Sage Weil <sage@inktank.com>
Merge remote branch 'gh/chef-3'