add write trace point for performance analysis
osd: Improve logging output including pg_shard_t as osd#(shard)

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Add logging of missed l_osd_agent_skip cases

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Error from start_flush() not checked in agent_maybe_flush()

This caused a very minor memory leak since ctx was allocated
Include logging of l_osd_agent_skip

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: start_flush() should check for missing clones and return if requested

Fixes: #7659

Signed-off-by: David Zafman <david.zafman@inktank.com>
PG: always clear agent_state in clear_primary_state

We aren't actually active between activate() and all_activated_committed().
We'd have to suspend agent_work during that period which seems like too much
complexity for too little work saved.

Fixes: #7904
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: hit_set_setup, agent_setup, skip if !active

We call these in on_activate and on_pool_change.  In the former, we are
necessarily active.  In the latter, we only want to do anything if we are
active (otherwise, it will be taken care of when we eventually do become
active).

Fixes: #7904
Signed-off-by: Samuel Just <sam.just@inktank.com>
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>
ReplicatedPG: improve get_object_context debugging

Signed-off-by: Samuel Just <sam.just@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>