rgw: radosgw-admin object rewrite

A radosgw-admin command that copies the object into itself while
preserving mtime and attributes so that data can be restriped.
Especially useful when migrating from argonaut (where objects
weren't striped).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 292c3c16fa87ed9b6d6abb22f45527ea2487c2a6)

Conflicts:
	src/rgw/rgw_admin.cc
civetweb: update subproject

Fixes: #7786

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Bug fix in the way crush_type is extracted from osd crush dump

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
While generating crush_types, avoiding item parsing, and calculating type count by just iterating thorugh buckets list

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Fetching the date from ceph osd dump as that is more reliable across ceph versions

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Included the total cluster size in components_count object

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Merge branch 'master' of https://github.com/enovance/ceph-brag into firefly
radosgw-admin: check params for object rewrite

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 28c716bccd955eaf68e9c739139c901ca4f419f7)
radosgw-admin: new 'bucket rewrite' command

Iterates through objects and rewrites them.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 3af09b9f9f6eaf2c80f0f0fd2ea87ac16c7ffcf8)

Conflicts:
	src/rgw/rgw_admin.cc
radosgw-admin: add some conditions for bucket rewrite

 --min-rewrite-size, --max-rewrite-size to specify object size
 conditions

 --start-date, --end-date to specify object mtime conditions (format is
 YYYY-MM-DD[ HH:MM:SS])

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit dbb2013eaf1eedf2a5cbcae1d314385ea033dbb8)
rgw: update bucket / object rewrite

Get code up to date for firefly, need to pass bucket owner for quota
related functionality.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
buffer: use Mutex instead of Spinlock for raw crcs

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix Session ref leak in handle_get_version

Signed-off-by: Sage Weil <sage@inktank.com>
ReplicatedPG::agent_work: skip hitset objects before getting object context

Otherwise, we might read the attr on a hitset object we are in the
process of deleting.

Fixes: #8086
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::_rollback_to: fix comment, clone certainly could be missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::cancel_flush: requeue dup_ops even if !op

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::agent_work: skip if head is missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::finish_promote: soid.clone may have been trimed, fix assert

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::process_copy_chunk: don't check snaps if we got head

Even if we are promoting a clone, we may be reading from head.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Make rados/rest bench work for multiple write instances without metadata conflict.
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>