osd: drop redundant check in handle_replica_op

This is what require_self_aliveness checks.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: pass Message* to most require_* helpers

These do nothing but op->get_req(); pass the Message* explicitly so that
non-OpRequest callers can use them.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: check that source OSD is valid for MOSDRepScrub

Make sure the message we got from the peer OSD is valid.  Specifically,
this avoids a race like this:

- A marks down B
- B sends MOSDRepScrub
- A accepts connection from B as new
- A replies to scrub
- B crashes because msgr seq 1 < expected seq 1000+

See #8880 for the most recent fix for requests.

Fixes: #9555
Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #3173 from ceph/wip-9555

osd: fix msgr reconnect crash from MOSDRepScrub messages (bug 9555)

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
osd/: fast dispatch, standard op path for MOSDRepScrub

Previously, it had its own queue, but better to simply use
the OpWQ along with everything else.  It also allows MOSDRepScrub
to be fast dispatched.  We use NORMAL priority since we want the
replica scrub message processed before recovery or client IO
messages -- the primary is blocking writes on the objects until
the replica responds.

Signed-off-by: Samuel Just <sjust@redhat.com>
OSD::OpWQ: fix spacing

Signed-off-by: Samuel Just <sjust@redhat.com>
OSD: add PGQueueable

Signed-off-by: Samuel Just <sjust@redhat.com>
osd/: convert snap trimming to use OpWQ

Signed-off-by: Samuel Just <sjust@redhat.com>
osd/: convert scrub to use the OpWQ

Signed-off-by: Samuel Just <sjust@redhat.com>
osd/: move recovery into opwq

Signed-off-by: Samuel Just <sjust@redhat.com>
osd/: make last_peering_reset and deleting checkable without pg lock

We will want to be able to quickly determine whether we can discard
events without grabbing the pg lock.

Signed-off-by: Samuel Just <sjust@redhat.com>
OSD: respect recovery deferral and pausing, move into OSDService

First, we move the recovery queueing machinery into OSDService for
simplicity and clarity.  blocked_recovery_ops holds recovery ops
pending while recovery is paused or deferred.  During tick(), we
scan the blocked_recovery_ops list to discard any obsolete ops to
avoid building up an unbounded number of obsolete recovery ops.

Signed-off-by: Samuel Just <sjust@redhat.com>