osd/ReplicatedPG: allow reads to proxy etc even if blocked

If we are not write ordered, continue with cache checks so that we can
(among other things) proxy reads while promoting.

Note that this may reorder reads for clients, but we've decided that's okay.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: tiering: cancel and requeue proxy read when needed

Cancel and requeue proxy read on the following cases:
1) on_shutdown
2) on_change
3) background promotion is done

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>

Conflicts:
	src/osd/ReplicatedPG.cc
	src/osd/ReplicatedPG.h
osd: tiering: proxy instead of redirect read in writeback mode when the
cache pool is full

To preserve read op order

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
osd: tiering: avoid duplicate promotion on proxy read

Do not promote if it is already undergoing in maybe_handle_cache.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
osd/ReplicatedPG: put proxy read completion on finisher

We can't use the synchronous completion callbacks (in fast dispatch
context) do to the proxy read completion work.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: improve proxy read cancelation

Avoid taking the PG lock for a canceled read op (if we are lucky).  Recheck
after the lock is taken for good measure.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: proxy read to the appropriate clone

If the head is present in the cache, we resolve to a specific clone in
the cache tier and want to read from that clone via proxy.  This avoids
problems where the snapset in the base tier is out of date.  If we are
missing the head, then we want to pass the request onmolested to the base
and resolve the snapid to a clone there.

Signed-off-by: Sage Weil <sage@redhat.com>
Objecter: add at_version to Objecter::op and Objecter::mutate

Used by proxy write to pass back the replay version.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
Objecter: add bytes_written in MOSDOpReply and Objecter::Op

Used by proxy write to pass back the bytes written from base tier.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
osd: tiering: add proxy write support

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
osd/ReplicatedPG: remove the peer_type assertion in eval_repop

When moving to proxy write, this assertion doesn't hold any more.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>