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>
init: add systemd service files

This patch adds systemd service files. It is possible to start and
enable multiple instances (per monid, osdid, mds name), e.g.

 # systemctl start ceph-mon@node01
 # systemctl enable ceph-mon@node01

 # systemctl start ceph-osd@0
 # systemctl enable ceph-osd@0

The ceph cluster can be set in the system config file:

 /etc/sysconfig/ceph

adding or editing the CLUSTER environment variable.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.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>
msg/SimpleMessenger: drop local_conneciton priv link on shutdwon

This breaks ref cycles between the local_connection and session, and let's
us drop the explicit set_priv() calls in OSD::shutdown().

Signed-off-by: Sage Weil <sage@redhat.com>
os/FileJournal: Update the journal header when closing journal

When closing journal, it should check must_write_header and update
journal header if must_write_header alreay set.
It can reduce the nosense journal-replay after restarting osd.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
Reviewed-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>
osd: fix bad Message* defer in C_SendMap and send_map_on_destruct

We were carrying a bare Message*, which could get freed if the op was
canceled (or possibly completed).  Instead, just stash the entity_name_t,
the only piece we need.  The Connection is properly ref counted so no
worries there.

Fixes: #8926
Signed-off-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>