ReplicatedPG::_rollback_to: fix comment, clone certainly could be missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::cancel_flush: requeue dup_ops even if !op

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::agent_work: skip if head is missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::finish_promote: soid.clone may have been trimed, fix assert

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::process_copy_chunk: don't check snaps if we got head

Even if we are promoting a clone, we may be reading from head.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::hit_set_persist: clean up degraded check

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: track the number of hit_set archive objects in a pg

Also, use this value in agent_choose_mode instead of the max
number.

Related: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
ECMsgTypes::ECSubWrite: fix at_version indentation

Signed-off-by: Samuel Just <sam.just@inktank.com>
encoding: use unqualified name for encode/decode in boost::optional encoding

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: propogate hit_set history with repop

We don't actually send the whole info on each repop, just the log
entries, updated stats, and a few other bits.  For hit_set ops, we need
to also communicate the new hit_set history status atomically with the
log entries and the transaction.  Thus, we add a channel for an optional
pg_hit_set_history_t field in PGBackend::submit_transaction interface
and associated messages and implementations to update the hit_set info
field along with the log entries.

This also means that hit_set_(persist|trim) update an
updated_hit_set_history field on the OpContext instead of directly
modifying the info field.

Fixes: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
PG,PGLog: update hit_set during peering

Fixes: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::agent_load_hit_sets: take ondisk_read_lock

Otherwise, the hit_set might be not yet written due to a recently
completed recovery.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not use shard for hit_set object names

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1705 from ceph/wip-8124

Wip 8124

Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG,rados: add CEPH_OSD_[COPY_FROM]_MAP_SNAP_TO_CLONE

When promoting a clone, we want to use the provided snapid to specify
specify the clone id directly.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not create whiteout clones

First, make_writeable treats whiteout heads like snapdir for
cloning purposes.  Second, to ensure that we send the correct
deletes on flush to the backing pool, we instead use oi.snaps
on any clone we are flushing to infer the snaps during which
head did not exist and send a delete as appropriate prior to
the copy_from.

Normally, we'd have a problem if the delete and the copy_from
completed, but an interval change intervened before the dirty
flag was cleared since we'd end up re-deleting the object.
To avoid that, we use the CEPH_OSD_FLAG_ORDERSNAP flag.

Additionally, we will use the correct snap_seq on the delete
or flush as appropriate to ensure that the previous clone
gets created with the same clone id as in the cache pool.

Fixes: #7942
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: if we get ENOENT on clone, remove clone from snapset

Fixes: #7916
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: in trim, grab w locks on obc and snapset_obc

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::do_op: check for blocked snapset obj

Otherwise, we might use an invalid snapset in find_object_context.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1703 from ceph/wip-7942

Wip 7942

Reviewed-by: Sage Weil <sage@inktank.com>