ReplicatedPG: support async reads on ec pools

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: make COPY_GET async read friendly

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: EOPNOTSUPP on ec_pool if there are omaps in the COPY_GET

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: don't leak the copy transaction

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: handle removing the old object in finish_copy_op

do_osd_ops will need to either copy the old version out of the
way or simply delete it depending on mod_desc.  Thus, defer
handling filling that part in until we finish the copy op.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::finish_copyfrom: check new_obs.exists, not obs.exists

If the transaction previously removed the object, the stat update
will have already happened.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: fill in mod_desc in finish_copyfrom

Signed-off-by: Samuel Just <sam.just@inktank.com>
test/osd/: verify length of buffer returned in read

Signed-off-by: Samuel Just <sam.just@inktank.com>
common/hobject: print shard as unsigned, not as char

Signed-off-by: Samuel Just <sam.just@inktank.com>
JounralingObjectStore: journal->committed_thru after replay

It's possible that the osd stopped between when the filestore
op_seq file was updated and when the journal was trimmed.  In
that case, it's possible that on boot the journal might be
full, and yet not be trimmed because commit_start assumes
there is no work to do.  Calling committed_thru on the journal
ensures that the journal matches committed_seq.

Backport: emperor dumpling
Fixes: 6756
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
JournalingObjectStore::journal_replay: don't call committed_thru

It suffices to set last_committed_seq correctly in
FileJournal::journal_replay.  This call to committed_thru can race with
the sync thread and trigger the assert(seq >= committed_seq) in
committed_thru.

Introduced in d8d27f13e11dcaefd3aa1c049b97c980283da575
Fixes: #6786
Signed-off-by: Samuel Just <sam.just@inktank.com>
FileStore::_collection_move_rename: remove source before closing guard

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog: delete old entry if the most recent remaining entry is a delete

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog: allow for empty pg log in update_range if log_tail == eversion_t()

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: no need to clear repop->*obc

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

Conflicts:

	src/osd/ReplicatedPG.cc
ReplicatedPG: fill in ctx->obc in simple_repop_create

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: src_obcs can now be empty

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog: we cannot rollback past a recovered object entry

We don't recover the older versions, so we can't do a rollback.
In general, this is ok since we had enough copies to recover it
in the first place.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: only advance last_backfill to head objects

If we rollback the log entries which created the clone at
last_backfill, it won't get rerun on the replica.  Instead,
only advance last_backfill when we hit head (or snapdir).

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog::rewind_divergent_log: we can rewind to tail, fix assert

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