ReplicatedPG: copy: switch out the CopyCallback interface

The tuple was already unwieldy with 4 members; I didn't want to add
more. Instead, create a new CopyResults struct which contains all the
object info and completion data, and pass the retval and a CopyResults*
in the CopyCallbackResults tuple.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG: copy: don't return from finish_copyfrom

The return value is meaningless; nothing in this function can fail.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG: promote: first draft pass at doing object promotion

This is not yet at all complete -- among other things, it will
retry forever on any object which doesn't exist in the underlying
pool. But it demonstrates the approach reasonably clearly.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>y
ReplicatedPG: promote: add the OpRequest to the Callback

This way we can do stuff to it, and we're about to.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG: promote: handle failed promotes

If we get an error back, reply to the client directly and remove
the op which triggered promotion from our blocked op queue.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
workunits: check errors propagate on cache pools in caching_redirects.sh

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
workunits: break down cache pool tests to be more precise; expand some

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: move r<0 handling into finish_promote()

Let logic in header, and will let us handle ENOENT with a whiteout.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: UNDIRTY is not a user_modify

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: use simple_repop_{create,submit} for finish_promote

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados_api_tier: rename tests

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados_api_tier: add simple promote-on-read test

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: create whiteout on promote ENOENT

If we try to fetch an object from the base tier and it is not present, we
can create a whiteout object.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: ENOENT when deleting a whiteout

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados_api_tier: verify delete creates whiteouts

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: set whiteout in cache pool on delete

If we delete an object in the cache pool, set the whiteout flag instead of
removing the on-disk object.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: clear whiteout when writing into cache tier

If we have a whiteout object and then write over it, clear the whiteout
flag.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: handle is_whiteout in do_osd_ops()

Most of the time we handle whiteouts by returning ENOENT before we even
get this far. However, for a mixed read/write transaction (e.g., a guard)
or certain ops (like create exclusive) we need to deal with the
exists == true and whiteout flag set case explicitly.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: set object_info and snapset xattrs on promote

For the normal write path, prepare_transaction() handles this for us.  In
this case, we need to do it explicitly.

Signed-off-by: Sage Weil <sage@inktank.com>
librados: add cache_flush(), cache_try_flus(), cache_evict() methods

Not yet implemented by the OSD.

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