include/ceph_features: add CEPH_FEATURES_OSD_ERASURE_CODES

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd: OSD: add binary compat feature for Erasure Codes

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd: OSDMap: check for erasure pools when getting features

If we have a pool with type Erasure, then we consider we require
CEPH_FEATURE_OSD_ERASURE_CODES.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd: OSDMap: add 'features' bit mask field to osd_xinfo_t

And make sure we dump it on osd_xinfo_t::dump().

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: handle osd features on boot

Add the osd's features to the osd's extra info field in the OSDMap
so we can track which OSDs are able to deal with Erasure Codes.

This will allow us to decide whether or not we are ready to set EC
whenever the user asks us to set EC on a pool -- which shall be
handled by a subsequent commit.

Fixes: 6028

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd: OSD: reflect OSDMap EC flag being set by setting on-disk feature

If OSDMap has the EC feature set, then update our superblock to
reflect as such, making our on-disk format incompatible with previous
OSDs without EC support.

Fixes: 6028

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph_osd: add EC to OSD's supported features used by the messenger

Fixes: 6028

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd: OSDMap: add 'get_up_osds()' function

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: add optional 'pool type' arg to 'osd pool create'

Allow specifying 'rep', 'raid4' and 'erasure'.
Only allow setting type 'erasure' if all up osds support erasure codes.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
pybind: test_ceph_argparse: test 'ceph osd pool create' with pool type

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
qa: workunit: cephtool: test osd pool create with erasure type

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mds: fixes for coverity scan

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Fix segmentation fault when handler is NULL pointer

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Merge pull request #969 from yuyuyu101/wip-7040

Fix segmentation fault when handler is NULL pointer

Reviewed-by: Sage Weil <sage@inktank.com>
mds: fix Resetter locking

ceph-mds --reset-journal didn't work; it would deadlock waiting for
the osdmap.  Comparing the init code in the Dumper (that worked) with
that in the Resetter (that didn't), I noticed the lock had to be
released before waiting for the osdmap.

Now the resetter works.  However, both the resetter and the dumper
fail an assertion after they've performed their task; I didn't look
into it:

../../src/msg/SimpleMessenger.cc: In function 'void SimpleMessenger::reaper()' t
hread 7fdc188d27c0 time 2013-12-19 04:48:16.930895
../../src/msg/SimpleMessenger.cc: 230: FAILED assert(!cleared)
 ceph version 0.72.1-6-g6bca44e (6bca44ec129d11f1c4f38357db8ae435616f2c7c)
 1: (SimpleMessenger::reaper()+0x706) [0x880da6]
 2: (SimpleMessenger::wait()+0x36f) [0x88180f]
 3: (Resetter::reset()+0x714) [0x56e664]
 4: (main()+0x1359) [0x562769]
 5: (__libc_start_main()+0xf5) [0x3632e21b45]
 6: /l/tmp/build/ceph/build/src/ceph-mds() [0x564e49]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to int
erpret this.
2013-12-19 04:48:16.934093 7fdc188d27c0 -1 ../../src/msg/SimpleMessenger.cc: In
function 'void SimpleMessenger::reaper()' thread 7fdc188d27c0 time 2013-12-19 04
:48:16.930895
../../src/msg/SimpleMessenger.cc: 230: FAILED assert(!cleared)

Signed-off-by: Alexandre Oliva <oliva@gnu.org>
Merge pull request #973 from ceph/wip-mds-coverity2

mds: fixes for coverity scan

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #941 from ceph/wip-6028

#6028 : ensure that erasure coded pools don't work until the osds can handle it

Reviewed-by: Sage Weil <sage@inktank.com>
osd: Fix assert which doesn't apply when compat_mode on

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
osd: conditionally disable dlclose of erasure code plugins

When profiling, tools such as valgrind --tool=callgrind require that the
dynamically loaded libraries are not dlclosed so they can collect usage
information.

The public ErasureCodePluginRegistry::disable_dlclose boolean is introduced
for this purpose.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: better performances for the erasure code example

The XOR based example is ten times slower than it could because it uses
the buffer::ptr[] operator. Use a temporary char * instead. It performs
as well as jerasure Reed Solomon when decoding with a single erasure:

$ ceph_erasure_code_benchmark \
   --plugin example  --parameter erasure-code-directory=.libs \
   --parameter erasure-code-technique=example \
   --parameter erasure-code-k=2 --parameter erasure-code-m=1 \
   --erasure 1 --workload decode --iterations 5000
8.095007	5GB

$ ceph_erasure_code_benchmark \
   --plugin jerasure  --parameter erasure-code-directory=.libs \
   --parameter erasure-code-technique=reed_sol_van \
   --parameter erasure-code-k=10 --parameter erasure-code-m=6 \
   --erasure 1 --workload decode --iterations 5000
7.870990	5GB

Signed-off-by: Loic Dachary <loic@dachary.org>