crush/CrushWrapper: explicitly set tunables on create, decode

Set the tunables to the 'default' values on create.

Default to the legacy values when we decode, so that an old map without
values defined gets legacy values.

Signed-off-by: Sage Weil <sage@inktank.com>
crush/CrushWrapper: default to the "new" bobtail-era tunables

These are supported as of kernel version v3.9:
 - chooseleaf_descend_once was added in 1604f48
 - others were added in 546f04e

And of course these are supported by bobtail and later.

Signed-off-by: Sage Weil <sage@inktank.com>
os/ObjectStore: pass cct to ctor

Signed-off-by: Sage Weil <sage@inktank.com>
os/ObjectStore: prevent copying

Signed-off-by: Sage Weil <sage@inktank.com>
os/ObjectStore: make getattrs() pure virtual

It is required.

Signed-off-by: Sage Weil <sage@inktank.com>
os/MemStore: implement reference 'memstore' backend

This is (as near to) a trivial ObjectStore backend for the OSD as we can
get at the moment.  Everything is stored in memory.  We are slightly
tricky with the locking, but not overly so.

On umount we dump everything out to disk, and on mount we load it all in
again, so we have some very coarse persistence/durability... just enough
to make this usable in a non-failure environment.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: queue pg deletion after on_removal txn

The removal is normally so slow that these don't really race, but they
could.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: default to 3x replication

3x is the recommendation; it should be the default too.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #907 from ceph/wip-3x

osd: default to 3x replication
Merge pull request #903 from ceph/wip-memstore

memstore: reference ObjectStore backend

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #888 from ceph/wip-crush-tunables

default to bobtail-era crush tunables.

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
crush: unittest CrushWrapper::move_bucket

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: remove redundant code from move_bucket

The following was introduced in 2012 by a2d0cff1b071bed84ac439e4fcf9ddfb936f89c8

  // un-set the device name so we can use add_item later
  build_rmap(name_map, name_rmap);
  name_map.erase(id);
  name_rmap.erase(id_name);

when insert_item refused to move a bucket for which a name already
exists. It was changed in 2013 by
4e2557a038dc1e8c68993ad8571d74e2eb8ea90a and now supports it. The
TestCrushWrapper unittest for move_bucket pass.

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: remove obsolete comments from link_bucket

Probably copy/pasted from move_bucket.

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: detach_bucket must test item >= 0 not > 0

Since detach_bucket is a private helper solely used by move_bucket which
contains another ( correct ) safeguard, the code cannot be reached and
the problem can never happen. If another function uses detach_bucket,
it may happen.

Signed-off-by: Loic Dachary <loic@dachary.org>
Revert "osd: default to 3x replication"

This reverts commit cb26fbde52f31b449af60acce3ced34e593d6e1e.

Fix unit tests and do integration tests first; this may have unexpected
consequences.
Merge pull request #913 from dachary/wip-crush-unittest

CrushWrapper::move_bucket unittest and minor fixes

Reviewed-by: Sage Weil <sage@inktank.com>
Merge git://github.com/ceph/ceph