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
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>
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>
osd_types: pg_t: add get_ancestor() method

Give us the ancestor for when the pool had a past value for pg_num.

Signed-off-by: Sage Weil <sage@inktank.com>
Simple mechanical cleanups

* Removed trailing and useless whitespaces
* Removed useless imports.

Signed-off-by: Christopher Glass <christopher.glass@canonical.com>
ReplicatedPG::mark_all_unfound_lost: delete local copy if necessary

There might be a local copy for an EC pool in the DELETE case.  The replica
copies should be already handled by merge_log.

Fixes: #7439
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::hit_set_persist: clean up degraded check

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: track the number of hit_set archive objects in a pg

Also, use this value in agent_choose_mode instead of the max
number.

Related: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>