librbd: skip zeroes when copying an image

This is the simple coarse-grained solution, but it works well in
common cases like a small base image resized with a bunch of empty
space at the end. Finer-grained sparseness can be copied by using rbd
{export,import}-diff.

Fixes: #6257
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #1575 from jdurgin/wip-librbd-cp-sparse

librbd: skip zeroes when copying an image

Reviewed-by: Sage Weil <sage@inktank.com>
rgw: reverse logic to identify next part

Fixes: #7935
The check that identifies whether we need to move to the next part when
iterating over an object was reversed.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
osd/ReplicatedPG: handle snapdir properly during scrub

Handle snapdir similarly to how head is treated when updating the
next_clone info.  Also, add a warning when we have a snapdir object and
head_exists == true (the converse of the existing check).

Fixes: #7937
Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: continue scrub logic when snapset.head_exists doesn't match

The 'continue' will cause more damange/noise than continuing because the
next_clone value won't be updated properly.

Signed-off-by: Sage Weil <sage@inktank.com>
librados: Add missing rados_wait_for_latest_osdmap()

Signed-off-by: David Zafman <david.zafman@inktank.com>
librados: Add missing C variants for alignment

Add rados_ioctx_pool_requires_alignment()
Add rados_ioctx_pool_required_alignment()

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Cleanup pools when FlushWriteRaces is done

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Fix ceph_test_rados_api_aio to clean up all test pools

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Fix ceph_test_rados_list_parallel to clean up test pool

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC test classes RadosTestEC and RadosTestECPP

Fixes: #7437

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_io

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_list

Fixes: #7437

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_stat

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC to ceph_test_rados_api_watch_notify

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_tier

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_lock

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add EC testing to ceph_test_rados_api_snaphots

Signed-off-by: David Zafman <david.zafman@inktank.com>
PG: set role for replicated even if role != shard

Fixes: #7939
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1577 from ceph/wip-7935

rgw: reverse logic to identify next part

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>