osd: include peer_info in pg query

This can be very useful when diagnosing peering problems.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/PG: move some pg stat update into a helper

When we publish PG stats to the monitor, we fill in a bunch of fields
with information about degraded objects, scrub timestamps, and other
sundry.

Move this into a helper that we will re-use shortly.

Note that we do *not* move anything that is semantically related to
the stats being published (like the 'reported' field).

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: update pg stat fields when they are queried

When we query a PG, fill in (most of) the same fields that get
populated when the stats are reported to the mon.

Fixes: #6988
Signed-off-by: Sage Weil <sage@inktank.com>
Fix typos in erasure code documents

Signed-off-by: Kun Huang <academicgareth@gmail.com>
rbd: return 0 and an empty list when pool is entirely empty

rbd_list will return -ENOENT when no rbd_directory object
exists. Handle this in the cli tool and interpret it as success with
an empty list.

Add this to the release notes since it changes command line behavior.

Fixes: #6693
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #1025 from pyKun/fix_typos

Fix typos in erasure code documents

Reviewed-by: Loic Dachary <loic@dachary.org>
Merge pull request #1028 from ceph/wip-empty-rbd-ls

rbd: return 0 and an empty list when pool is entirely empty

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #950 from ceph/wip-pg-stat

update pg stats when they are queried; share peer_info on query too

Reviewed-by: Loic Dachary <loic@dachary.org>
doc/release-notes: v0.74

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1020 from dachary/wip-ceph-disk-override

ceph-disk: prepare --data-dir must not override files

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1030 from dachary/wip-crush-location

osdc: = is not a delimiter in --crush-location

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1031 from dachary/wip-parse-args

CEPH_ARGS should trim whitespaces

Reviewed-by: Sage Weil <sage@inktank.com>
ceph-disk: fix Error() messages formatting

Mainly using % instead of ,

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: remove noop try:

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: fix activate() indent

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: do not hide main_activate() exceptions

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: make exception handling terse in main_activate_journal

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: add --hardcoded-path to control execution

/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.

The hardcoded path cannot simply be removed because it will most likely
lead to unexpected and difficult to diagnose problems for existing
installations where the PATH finds the program elsewhere.

The --hardcoded-path option is added and defaults to /usr/bin. If set to
an empty value, the PATH will be used.

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: which() uses PATH first

Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph-disk: use ceph-conf to retrieve options

Instead of ceph-osd, for clarity.

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