os/ObjectStore: add collection_move_rename

Add method to move an object between collections *and* change its name.

Signed-off-by: Sage Weil <sage@inktank.com>
os/FileStore: implement collection_move_rename

This is similar to a collection_add + collection_move sequence in that we
apply the same replay guards.  The difference is that we roll it up into
a single operation, change the filename, and make the omap content carry
over by calling DBObjectMap->clone (as there is no rename function or
collection awareness in the DBObjectMap).

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: move coll_t::META_COLL definition

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: generate one-off unique temp object names

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: drop dead code from parallelexec issue_repop

This is unused and references otherwise unused variables we can remove!

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: drop unused issue_repop() arguments

These are cruft from the old parallelexec mode and can be removed.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: flag new/old temp objects in MOSDSubOp

Allow us to mark when we start and stop using a temporary object in a
sub_op.  If we start to use it, make sure the collection exists on the
replica.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: allow RepGathers with no version

If the repop has no version set, skip the updates to last_update and
last_update_{applied,ondisk} and last_complete_ondisk.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: stage object chunks to replicas during COPY_FROM

As we get each chunk of data during the COPY_FROM operation, write it out
to a temporary object on the replicas.  When we get all the pieces, move
it into place.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: more readable output

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: factor some bits into finish_copy

This is a bit cleaner and hopefully more usable for osd-driven cache
promotion.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add infrastructure to block io on an obc

Add an is_blocked() method for the obc, and add infrastructure to block
any operations if it returns true.  Clean up on_change(), and add a helper
to kick an obc when whatever condition leading to it being blocked is no
longer true.

For now, is_blocked() is always false...

Signed-off-by: Sage Weil <sage@inktank.com>
osd: block requests on object during COPY_FROM

Block any request on an object (read or write) during the COPY_FROM
operation.

This could potentially be broken down into read vs write operations without
much difficulty, but blocking any op indescriminately is sufficient for
now, so let's keep it simple.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: use get_version64() throughout

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: submit a racing read with every COPY_FROM

Verify that the racing read completes after the COPY_FROM does (i.e., is
blocked by it).

Signed-off-by: Sage Weil <sage@inktank.com>
osd: allow a copy_from without knowing the src_version

If we don't specify the version up front, learn the version after the first
chunk and enforce it thereafter to ensure we do not get torn content.

Signed-off-by: Sage Weil <sage@inktank.com>
old_temp_oid -> discard_temp_oid
librados: test copy_from without src_version specified

Signed-off-by: Sage Weil <sage@inktank.com>
os/FileStore: fix omap clearing by collection_move_rename

We want to clear out the omap entries for the old name even though the
file is linked into a new location; this is unlike the normal unlink
behavior (because we are doing a rename).

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