ReplicatedPG: take clone write lock as well in make_writeable

Otherwise, we might start backfilling the clone before the op is
complete.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: release backfill state on_global_recover not peer recover

There may now be multiple backfill peers.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: take snapset_obc write lock where appropriate

Otherwise, we might read it for backfill before it's fully created
on a peer.

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG::remove_snap_mapped_object: use pg_whoami.shard

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: just ignore rollbacks on objects we have already failed to rollback

The relevant changes to missing and/or the filestore will have
already been made.

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog::merge_old_entry: simplify the oe.version > ne.version case

If ne.version < oe.version, the correct answer is to rollback oe.version
if possible regardless of what the entries are.

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: Add a shard parameter to SnapMapper to handle multiple pg shards

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd: pass in version to recover to recover_object

Otherwise we need to do some annoying contortions to
get it out of the missing sets.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ObjectStore: use ghobject_t for setattrs

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd_types: introduce spg_t, pg_shard_t

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGBackend/ReplicatedBackend: move rollback methods into PGBackend

These will end up essentially unchanged in ECBackend as it turns out.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedBackend/PGBackend: move objects_* methods into PGBackend

These also are unchanged in ECBackend.

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGBackend: use whoami_shard().shard in rollback*, objects*

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGBackend/ReplicatedBackend: move temp handling into PGBackend

Temp handling is also the same in ReplicatedBackend as in ECBackend.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedBackend: excise OSDService*

This should eventually make it easier to mock out a PGBackend::Listener.

Signed-off-by: Samuel Just <sam.just@inktank.com>
messages/: include shard information in various pg messages

We can no longer use the messenger source information to determine
the origin of the message since an osd might have more than one
shard of a particular pg.  Thus, we need to include a pg_shard_t
from field to indicate origin.  Similarly, pg_t is no longer
sufficient to specify the destination pg, we instead use spg_t.
In the event that we get a message from an old peer, we default
from to pg_shard_t(get_source().num(), ghobject_t::no_shard())
and spg_t to spg_t(pgid, ghobject_t::no_shard()).  This suffices
because non-NO_SHARD shards can only appear once ec pools have
been enabled -- and doing that bans unenlightened osds.

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: refer to pg by spg_t and replica by pg_shard_t

We may have multiple pg shards on the same osd for an
ec pool.  Thus, replicas must be referred to by <osd, shard>
and pgs by <pgid, shard>.

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: refactor calc_acting to handle pg_shard_t changes

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: introduce calc_ec_acting

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSDMap: fill in get_primary_shard

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