ReplicatedPG: Fill in rollback info for log events

Signed-off-by: Samuel Just <sam.just@inktank.com>
PGLog: create interface allowing interface user to cleanup/rollback

We need to be able to allow the PGLog interface user to provide
logic for rolling back and trimming log entries.  To that end,
serveral PGLog methods now take a LogEntryHander.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/test/osd/TestPGLog: fix PGLog test cases for changed methods

Signed-off-by: Samuel Just <sam.just@inktank.com>
ObjectStore: _collection_move_rename needs to increment ops

Signed-off-by: Samuel Just <sam.just@inktank.com>
TestRados: skip 0 weight ops
osd/: add sync/async read methods to PGBackend

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: use pgbackend->objects_read_sync() as appropriate

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/: add CEPH_OSD_OP_READ_SYNC

EC pools won't support SYNC reads.  This means that TMAP and friends
along with reads from an object class will not be supported.

Signed-off-by: Samuel Just <sam.just@inktank.com>
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>