librbd: use order-agnostic default stripe parameters

This way the default striping style of splitting into
object-sized chunks still works with non-default orders
specified.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: remove accidental repeated option

--stripe-count is already parsed above this

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: respect rbd_default_* parameters

Treat rbd_default_{format,order,stripe_unit,stripe_count} as defaults for
the usual arguments for specifying those properties.

librbd::create() is affected by rbd_default_format, so we need to
explicitly override it if --image-format is set. The rest of the
parameters are passed explicitly when they are used, so their rbd_default
equivalents don't matter.

Fixes: #8821
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
mon/OSDMonitor: improve no-op cache_mode set check

If we have a pending pool value but the cache_mode hasn't changed, this is
still a no-op (and we don't need to block).

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
osd/osd_types: add pg_pool_t FLAG_COMPLETE_CLONES

Set a flag on the pg_pool_t when we change cache_mode NONE.  This
is because object promotion may promote heads without all of the clones,
and when we switch the cache_mode back those objects may remain.  Do
this on any cache_mode change (to or from NONE) to capture legacy
pools that were set up before this flag existed.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: do not complain about missing clones when INCOMPLETE_CLONES is set

When scrubbing, do not complain about missing cloens when we are in a
caching mode *or* when the INCOMPLETE_CLONES flag is set.  Both are
indicators that we may be missing clones and that that is okay.

Fixes: #8882
Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: observed INCOMPLETE_CLONES when doing clone subsets

During recovery, we can clone subsets if we know that all clones will be
present.  We skip this on caching pools because they may not be; do the
same when INCOMPLETE_CLONES is set.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: observe INCOMPLETE_CLONES in is_present_clone()

We cannot assume that just because cache_mode is NONE that we will have
all clones present; check for the absense of the INCOMPLETE_CLONES flag
here too.

Signed-off-by: Sage Weil <sage@redhat.com>
test: catch a straggler still using 'data' pool

Used rbd pool instead, which is still created by default.

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

test: catch a straggler still using 'data' pool

Reviewed-by: Sage Weil <sage@redhat.com>
doc: Update doc from user feedback.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Add additional hyperlink to Cache Tiering defaults.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge pull request #2141 from ceph/wip-8882

osd: set pg flag INCOMPLETE_CLONES when turning off cache pool

Reviewed-by: Greg Farnum <greg@inktank.com>

First patch Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
rgw: align object chunk size with pool alignment

Fixes: #8442
Backport: firefly
Data pools might have strict write alignment requirements. Use pool
alignment info when setting the max_chunk_size for the write.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw: object write should not exceed part size

Fixes: #8928

This can happen if the stripe size is not a multiple of the chunk size.

Backport: firefly

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Merge pull request #2143 from ceph/wip-rgw-align

Wip rgw align

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
common/RefCountedObject: fix use-after-free in debug print

We could race with another thread that deletes this right after we call
dec().  Our access of cct would then become a use-after-free.  Valgrind
managed to turn this up.

Copy it into a local variable before the dec() to be safe, and move the
dout line below to make this possibility explicit and obvious in the code.

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2145 from ceph/wip-ref-put

common/RefCountedObject: fix use-after-free in debug print

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #2112 from ceph/wip-rbd-defaults

respect rbd_default_* parameters in /usr/bin/rbd

Reviewed-by: Sage Weil <sage@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>
(cherry picked from commit 5438500af8979fda32e61714ae40b71c7ffdfd15)