]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: drop previous interval ops even if primary happens to be the same
authorSage Weil <sage@inktank.com>
Tue, 8 Apr 2014 16:00:11 +0000 (09:00 -0700)
committerSage Weil <sage@inktank.com>
Tue, 8 Apr 2014 16:06:32 +0000 (09:06 -0700)
commit5d6116199eb4010ca40df8cc4f1ab3ead0ac761a
tree170f33270d7f5af6e869577d2172fa4e6c869635
parentd3833ddafe40889314dec50c1b233af00f1ee6fd
osd: drop previous interval ops even if primary happens to be the same

If we have two consecutive intervals with the same primary, the client
will not resend the op and the same_primary_since epoch will not change,
and all is well.

If, however, we have 3 intervals, and the primary changes away and then
back to a particular OSD, the OSD will currently still process the old
request (assuming the timing works out) because it is currently the
primary.  This is unnecessary because the client will resend the request.
It may even introduce a hard-to-hit ordering problem since whether or not
the OSD processes the message becomes dependent on how many subsequent
maps it has consumed when the request is processed.

Instead, simplify the minor tangle of helpers by making a single simple
check that discards requests from before same_primary_since.  We can then
avoid using the same_for_*() helpers and drop the check from
handle_misdireted_op(), which is also nice because the name is now accurate
(it *only* deals with ops that are in fact misdirected, not just slow to
arrive).

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc
src/osd/PG.cc