]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
objecter: use ordered map<> for tracking tids to preserve order on resend
authorSage Weil <sage@inktank.com>
Wed, 22 Aug 2012 04:12:33 +0000 (21:12 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 18 Sep 2012 17:43:22 +0000 (10:43 -0700)
commit379aa80ac3a313025e433cefd239ddbeec45f9e7
treeaec6929cb930517c6db72e7cdfa3fc92b25f83a6
parent54788d0da40608fb8ccf8f16039536729881d542
objecter: use ordered map<> for tracking tids to preserve order on resend

We are using a hash_map<> to map tids to Op*'s.  In handle_osd_map(),
we will recalc_op_target() on each Op in a random (hash) order.  These
will get put in a temp map<tid,Op*> to ensure they are resent in the
correct order, but their order on the session->ops list will be random.

Then later, if we reset an OSD connection, we will resend everything for
that session in ops order, which is be incorrect.

Fix this by explicitly reordering the requests to resend in
kick_requests(), much like we do in handle_osd_map().  This lets us
continue to use a hash_map<>, which is faster for reasonable numbers of
requests.  A simpler but slower fix would be to just use map<> instead.

This is one of many bugs contributing to #2947.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 1113a6c56739a56871f01fa13da881dab36a32c4)
src/osdc/Objecter.cc