mon/PaxosService: remove unused exists_version() variant

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonmapMonitor: avoid exists_version() helper

We are the only user; open-code it.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused helpers

Signed-off-by: Sage Weil <sage@inktank.com>
mon: make PaxosService::get_value() int return type 64-bit

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix mkfs monmap cleanup

exists_key(a,b) was looking for "monmap/mkfs/monmap".

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: remove mkfs helpers

Keep it simple.  These are one-liners.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: simplify full helpers, drop single-use helper

We are the only caller for get_version(prefix, name), so move it inline
and drop it.  Also rename full_version_name to full_prefix_name, which I
find slightly less confusing.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/OSDMOnitor: use provided get_version_full()

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused {get,set,put}_version(prefix, a, bl)

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: some whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused last_accepted_name

Signed-off-by: Sage Weil <sage@inktank.com>
Add rc script for rbd map/unmap

Init script for mapping/unmapping rbd device on startup and shutdown.
On start, map rbd dev according to /etc/rbdmap, and force mount -a
On stop, umount file system depending on rbd and unmap all rbd
Since some distribution use symlink for /etc/mtab, the user-space attribute _netdev is not enough to umount file system before rbd dev.
(also concern: #1790)

Signed-off-by: Laurent Barbe <laurent@ksperis.com>
skip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined

The TEST(EXT4StoreTest, _detect_fs) test is meant to be run from
qa/workunits/filestore/filestore.sh, after the ext4 file system was
created. If the DISK and MOUNTPOINT environment variables are not
defined, display a message explaining the expected environment and
silentely skip the test. The tests in store_test.cc are not unit tests
because they depend on their environment.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
get_xattr() can return more than 4KB

Instead of failing if the attribute to be returned is larger than 4KB,
double the buffer size each time librados.rados_getxattr returns
-errno.ERANGE and try again.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
v0.65
mon/PaxosService: s/get_version()/get_last_committed()/

Avoid aliasing simple accessors; use a single name instead.  Also, function
name overloading will throw a wrench in the class inheritance later.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMap: make int type explicit

We get away with this because int is 32-bits on x86_64 and i386 both, but
we should be explicit anyway!

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: drop some dead code

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: move upgrade_format() machinery into PaxosService

We originally did this in AuthMonitor, but it is perfect for PGMonitor too,
so make it generic.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/AuthMonitor: start at format 1 (latest) for new clusters

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