rgw: copy object data if target bucket is in a different pool

Fixes: #9039
Backport: firefly

The new manifest does not provide a way to put the head and the tail in
separate pools. In any case, if an object is copied between buckets in
different pools, we may really just want the object to be copied, rather
than reference counted.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 5d3a7e595f47455896304bf358e5251915d0f16f)
ceph-disk: bootstrap-osd keyring ignores --statedir

The STATEDIR variable is used to initialize the bootstrap-osd keyring
before it gets a chance to be overriden by --statedir. Replace it with
{statedir} so that it can be substituted after all options have been
parsed.

http://tracker.ceph.com/issues/9653 Fixes: #9653

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit fa0bd06b4657e5b84e237b76033ac3d3478b6a1f)
mon/MonitorDBStore: add get_{keys,bytes}() accounting to Transaction

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit fd421b26748e872ddf8e0f068dda2106853edff1)
mon/Paxos: add perfcounters for most paxos operations

I'm focusing primarily on the ones that result in IO here.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit b09b8563d35dda23faed43afef2a983e93a879c5)
ceph.spec.in: add ceph-libs-compat

Added a ceph-libs-compat package in accordance with Fedora packaging
guidelines [1], to handle the recent package split more gracefully.
In Fedora this is necessary because there are already other packages
depending on ceph-libs, that need to be adjusted to depend on the new
split packages instead. In the mean time, ceph-libs-compat prevents
breakage.

[1] http://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
(cherry picked from commit 6c264f2204cbd54d90b02101e40ac9aa5aa72d7c)

Conflicts:

	ceph.spec.in
ceph.spec.in: Add obsoletes for libcephfs

This fixes a bug for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1116614

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
(cherry picked from commit e9da2d8f2142771f206ef67f19e7f194855275d0)
ceph.spec.in, init-ceph.in: Don't autostart ceph service on Fedora.

This patch is taken from the current Fedora package and makes the upstream
ceph.spec compliant with Fedora policy. The goal is to be fully compliant
upstream so that we can replace current Fedora package with upstream
package to fix many bugs in Fedora.

Addition from Dan Mick <dan.mick@inktank.com>:
Do this for RHEL and Centos as well, since they surely will benefit
from the same policy.   Note: this requires changes to
autobuild-ceph and ceph-build scripts, which currently copy
only the dist tarball to the rpmbuild/SOURCES dir.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
Signed-off-by: Dan Mick <dan.mick@inktank.com>:
(cherry picked from commit 461523b06cdf93e32f1d8b354ac3799e73162d33)
Move fedora patch file (used by ceph.spec.in) to rpm/ subdir

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 06b92cee621cbe33a6f17e8c64169db4453a5160)
ceph.spec.in: We need those nice recent changes for rhel7 in Fedora too.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
(cherry picked from commit 00877ae502ac52613bcd5c5c834d72787d668dca)
ceph.spec.in: Obselete ceph-libcephfs (not libcephfs)

I am guessing that because it was a sub-package libcephfs was mistakenly
used instead of ceph-libcephfs.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit 75985024bd30ca6fbe4c61aa7f7cbe5306c9a988)
ceph.spec.in: No version on ceph-libs Obsoletes.

If we are installing with the new package structure we don't ever want the
new package to co-exist with the old one; this includes the mistakenly-
released v0.81 on Fedora, which should be removed in favor of this
version.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 8f95daf66b5fdb2a8141988480f984c1249599c5)
ceph.spec.in: Obsolete all older versions.

Now this changeset can be used on all current ceph releases that already
have the package split.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
(cherry picked from commit 875a99e25f0ad2cb47149a3b5a28b4771a09125c)
ceph.spec.in: Add a small comment on the empty %files section

as suggested by Dan Mick.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
(cherry picked from commit e37b262c7928934530c5bb09fe56f83eb61f4244)
ceph.spec.in: tests for rhel or centos need to not include _version

rhel_version and centos_version are apparently the OpenSUSE Build
names; the native macros are just "rhel" and "centos" (and contain
a version number, should it be necessary).

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 7474f720c2418cf3d52b755f2b60c524e413570a)
ceph.spec.in: remove BuildRoot

Deprecated

Fixes: #8143
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 401319a1527dd9cb5398916105d31e7ec065763d)
ceph.spec.: add epoch

This is done in fedora packaging.  Do it here too so that you can move
between upstream packages (from ceph.com) and fedora and other derivatives
will builds.

Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 83888362089346e473d6fd6e1d366b826d7bd739)

Conflicts:

	ceph.spec.in
ceph.spec: fix typo

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit da9ae5c92ecb4059e0ec6be5ce03af46430e76a5)
Merge pull request #2634 from dachary/wip-9653-ceph-disk-bootstrap-osd-firefly

ceph-disk: bootstrap-osd keyring ignores --statedir (firefly)
Crush: Ensuring at most num-rep osds are selected

Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by the rule.

Fixes: #9492

Signed-off-by: Johnu George <johnugeo@cisco.com>
(cherry picked from commit 6b4d1aa99718e3b367496326c1e64551330fabc0)
Crush: Ensuring at most num-rep osds are selected

Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by indep rule. The fix for firstn rules is already
merged as part of bug #9492. Required test files are added.

Fixes: #9492

Signed-off-by: Johnu George johnugeo@cisco.com
(cherry picked from commit 234b066ba04976783d15ff2abc3e81b6cc06fb10)