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>
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>
ceph_test_rados_api_tier: do fewer writes in HitSetWrite

We don't need to do quite so many writes.  It can be slow when we are
thrashing and aren't doing anything in parallel.

Fixes: #8932
Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: fix cache full -> not full requeueing when !active

We only want to do this if is_active().  Otherwise, the normal
requeueing code will do its thing, taking care to get the queue orders
correct.

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: requeue cache full waiters if no longer writeback

If the cache is full, we block some requests, and then we change the
cache_mode to something else (say, forward), the full waiters don't get
requeued until the cache becomes un-full.  In the meantime, however, later
requests will get processed and redirected, breaking the op ordering.

Fix this by requeueing any full waiters if we see that the cache_mode is
not writeback.

Fixes: #8931
Signed-off-by: Sage Weil <sage@redhat.com>
configure: don't link blkid, udev to everything

These are already explicitly called out for libkrbd; don't need them in
LIBS.

Signed-off-by: Sage Weil <sage@redhat.com>
configure.ac: link libboost_thread only with json-spirit

Signed-off-by: Sage Weil <sage@redhat.com>
librbd: make rbd_get_parent_info() accept NULL out params

The C++ version of rbd_get_parent_info() allows passing NULL for parent
image name, image name and snapshot name out parameters.  Make C API do
the same both for consistency and to make it easier to check whether
the image at hand has a parent or not.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
test_librbd_fsx: introduce rbd_image_has_parent()

A helper to check whether the image associated with the ctx has
a parent or not.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
test_librbd_fsx: randomize_parent_overlap

Truncate base images after they have been cloned from to cover more
code paths and make sure that clients look at snapshot parent_overlap
(i.e. parent_overlap of the base image at the time the snapshot was
taken) and not that of the base image (i.e. parent_overlap of the base
image as of now).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
test_librbd_fsx: clone/flatten probabilities

Higher the clone probability to 8% and lower the probability of flatten
to 2%.  This should give us longer parent chaines (before this we would
usually have one parent and even then only for a few ops time).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
tools/cephfs: fuller header in dump/undump

There were two problems here:
 * write_pos was modified through an undump/dump cycle,
   because it was probed during recovery.
 * stream format was being forgotten.

Signed-off-by: John Spray <john.spray@redhat.com>
upstart/ceph-osd.conf: bump nofile limit up by 10x

This should ensure that we don't hit this limit on all but the very biggest
clusters.  We seen it hit on a ~500 OSD dumpling cluster.

Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2153 from ceph/wip-fsx-overlap

librbd API fix + wip-fsx-overlap

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #2150 from ceph/wip-libs

don't link everything with blkid, udev, and boost_threads
unittest_crush_wrapper: fix build

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

osd: fix ops blocked by full cache tier dequeue

Reviewed-by: Greg Farnum <greg@inktank.com>
Merge pull request #2146 from ceph/wip-8932

ceph_test_rados_api_tier: do fewer writes in HitSetWrite

Reviewed-by: Greg Farnum <greg@inktank.com>
Merge pull request #2139 from ceph/wip-journal-header

os/FileJournal: Update the journal header when closing journal

Reviewed-by: Greg Farnum <greg@inktank.com>