Makefile: fix ceph_sbindir

From Denis Kaganovich <mahatma@eu.by>:

At least in some cases, scripts (ceph-disk*, ceph-create-keys)
installing into /usr/usr/sbin. This happened while
"ceph_sbindir = $(prefix)$(sbindir)" in src/Makefile.am and "
./configure --prefix=/usr ..." (Gentoo's default configure call).
I don't dig too deep, but IMHO it can be result of "prefix=" &
"exec_prefix=" disorder. Fixed for me by "ceph_sbindir = $(sbindir)"
(I don't try other configure behaviors, but looks universal).

Reported-by: Denis Kaganovich <mahatma@eu.by>
Fixes: #5492
Signed-off-by: Sage Weil <sage@inktank.com>
ObjectStore,Context: add register_on_complete

Signed-off-by: Samuel Just <sam.just@inktank.com>
ObjectStore: only register non-null contexts

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: do not use temp_coll for single-step pushes

If we are recovering an object in a single step, there is no need to
write it to temp and then move it.  Avoiding that is a very good thing
when the FileStore has to do an fsync() for non-btrfs fs's.

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

Conflicts:
	src/osd/ReplicatedPG.cc
osd_types: add PushOp, PushReplyOp PullOp

Signed-off-by: Samuel Just <sam.just@inktank.com>
rgw: Add explicit messages in radosgw init script

http://tracker.ceph.com/issues/5478 fixes #5478

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
Merge pull request #389 from ceph/wip-5492

Makefile: fix ceph_sbindir

Reviewed-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
qa/workunits/fs/test_o_trunc.sh: fix .sh to match new bin location

To match 83f308962c53eec10db9e496987a9e4be7c87e9b.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rbd/kernel.sh: move modprobe up

Needs to happen before cleanup.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rbd/simple_big.sh: don't ENOSPC every time

Set the count on the initial dd so we don't always ENOSPC.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #407 from dachary/wip-5487

unit tests for ObjectContext read/write locks

Reviewed-by: Samuel Just <sam.just@inktank.com>
common/crc32c: skip cpu detection incantation on not x86_64

On i386 this fails to build with

common/crc32c-intel.c: In function 'ceph_have_crc32c_intel':
error: common/crc32c-intel.c:79:9: PIC register clobbered by 'ebx' in 'asm'

ARM had more to complain about.

Not sure where this test came from, but it is clearly not meant for
anything other than x86_64.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
client: remove O_LAZY

The once-upon-a-time unique O_LAZY value I chose forever ago is now
O_NOATIME, which means that some clients are choosing relaxed
consistency without meaning to.

It is highly unlikely that a real O_LAZY will ever exist, and we can
select it in the ceph case with the ioctl or libcephfs call, so drop
any support for doing this via open(2) flags.

Update doc/lazy_posix.txt file re: lazy io.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Merge pull request #397 from kri5/wip-5478

rgw: Add explicit messages in radosgw init script

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Merge pull request #403 from ceph/wip-olazy

merge: O_LAZY flag removal

Reviewed-by: Greg Farnum <greg@inktank.com
osd/osd_types: fix pg_stat_t::dump for last_epoch_clean

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Revert "Makefile: fix ceph_sbindir"

This reverts commit 352f362567bf270d0896fb7573df4ae5139a56fb.

Reverting this commit because it causes problems with the debian build, and
reopening #5492.   The root problem appears to be lack of support by GNU
autotools for installing into both /sbin and /usr/sbin using the standard
location variables.

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
mon: fix osdmap stash, trim to retain complete history of full maps

The current interaction between sync and stashing full osdmaps only on
active mons means that a sync can result in an incomplete osdmap_full
history:

 - mon.c starts a full sync
 - during sync, active osdmap service should_stash_full() is true and
   includes a full in the txn
 - mon.c sync finishes
 - mon.c update_from_paxos gets "latest" stashed that it got from the
   paxos txn
 - mon.c does *not* walk to previous inc maps to complete it's collection
   of full maps.

To fix this, we disable the periodic/random stash of full maps by the
osdmap service.

This introduces a new problem: we must have at least one full map (the first
one) in order for a mon that just synced to build it's full collection.
Extend the encode_trim() process to allow the osdmap service to include
the oldest full map with the trim txn.  This is more complex than just
writing the full maps in the txn, but cheaper--we only write the full
map at trim time.

This *might* be related to previous bugs where the full osdmap was
missing, or case where leveldb keys seemed to 'disappear'.

Fixes: #5512
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
mon: implement simple 'scrub' command

Compare all keys within the sync'ed prefixes across members of the quorum
and compare the key counts and CRC for inconsistencies.

Currently this is a one-shot inefficient hammer.  We'll want to make this
work in chunks before it is usable in production environments.

Protect with a feature bit to avoid sending MMonScrub to mons who can't
decode it.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
v0.66