debian: move ceph-dencoder to ceph from ceph-common

It links against the world currently (notably leveldb).  Not nice for the
client-side lib.

Signed-off-by: Sage Weil <sage@redhat.com>
ceph.spec: move ceph-dencoder to ceph from ceph-common

Signed-off-by: Sage Weil <sage@redhat.com>
Fix size of network protocol intergers.

This fixes the size of some integers that are visible in the network
protocol.  There should be no change for machines where sizeof(int) ==
4.

Signed-Of-By: Kevin Cox <kevincox@kevincox.ca>
vstart.sh: default to 3 osds

Signed-off-by: Sage Weil <sage@inktank.com>
configure: do not link leveldb with everything

Detect leveldb, but do not let autoconf blindly link it with everything on the
planet.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Sighed-off-by: Sage Weil <sage@redhat.com>
mon/MDSMonitor: fix msg on idempotent `fs rm`

Was outputting trailing "unrecognised command"
because we returned 0 instead of setting r=0.

Signed-off-by: John Spray <john.spray@redhat.com>
mon: carry last_failure_osd_epoch across `fs new`

So that new MDSs in a new filesystem are guaranteed
to be up to date with anything we blacklisted
from a filesystem coming before.

Signed-off-by: John Spray <john.spray@redhat.com>
qa: generalise cephtool for vstart+MDS

Previously this test assumed no pre-existing
filesystem and no MDS running.  Generalize it
to nuke any existing filesystems found before
running, so that you can use it inside a vstart
cluster that had MDS>0.

Signed-off-by: John Spray <john.spray@redhat.com>
Merge pull request #2108 from kevincox/sizeint

Fix size of network protocol intergers.

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2119 from ceph/wip-vstart-existing-mds

Wip vstart existing mds

Reviewed-by: Sage Weil <sage@redhat.com>
test: add a missing semicolon

Broke in df8f48628.

Signed-off-by: John Spray <john.spray@redhat.com>
Merge pull request #2114 from ceph/wip-vstart

vstart.sh: default to 3 osds

Not-NAKed-by: John Spray <john.spray@inktank.com>
Merge pull request #2104 from ceph/wip-dencoder

move ceph-dencoder to ceph from ceph-common

Reviewed-by: Dan Mick <dan.mick@inktank.com>
osdc/Journaler: validate header on load and save

Previously if the journal header contained invalid
write, expire or trimmed offsets, we would end up
hitting a hard-to-understand assertion much later.

Instead, raise the error right away if the fields
are identifiably bad at load time, and assert that
they're valid before persisting them.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: fix journal reformat failure in standbyreplay

In the 0.82 release, standbyreplay MDS daemons would try
to reformat the jouranl if they saw an older version on
disk, where this should have only been done by the active
MDS for the rank.  Depending on timing, this could cause
fatal corruption of the journal.

This change handles the following cases:
* only do reformat if not in standbyreplay (else raise EAGAIN
to keep trying til an active mds reformats it)
* if journal header goes away while in standbyreplay then raise
EAGAIN (handle rewrite happening in background)
* if journal version is greater than the max supported, suicide

Fixes: #8811

Signed-off-by: John Spray <john.spray@redhat.com>
doc: fix example s/inspect/journal inspect/

Signed-off-by: John Spray <john.spray@redhat.com>
osdc: refactor JOURNAL_FORMAT_* constants to enum

...so that the upper limit doesn't have to be updated
by hand.

Signed-off-by: John Spray <john.spray@redhat.com>
osd: add config for osd_max_object_name_len = 2048 (was hard-coded at 4096)

Previously we had a hard coded limit of 4096.  Objects > 3k crash the OSD
when running on ext4, although they probably work on xfs.  But rgw only
generates objects a bit over 1024 bytes (maybe 1200 tops?), so let set a
more reasonable limit here.  2048 is a nice round number and should be
safe.

Add a test.

Fixes: #8174
Signed-off-by: Sage Weil <sage@redhat.com>
os: add ObjectStore::get_max_attr_name_length()

Most importantly, capture that attrs on FileStore can't be more than about
100 chars.  The Linux xattrs can only be 128 chars, but we also have some
prefixing we do.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: add config for osd_max_attr_name_len = 100

Set a limit on the length of an attr name.  The fs can only take 128
bytes, but we were not imposing any limit.

Add a test.

Reported-by: Haomai Wang <haomaiwang@gmail.com>
Signed-off-by: Sage Weil <sage@inktank.com>