]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/Pipe: avoid creating empty out_q entry
authorSage Weil <sage@inktank.com>
Tue, 16 Jul 2013 17:09:02 +0000 (10:09 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 23:20:36 +0000 (16:20 -0700)
commitae85a0a101d624363fe761c06ecd52d3d38ba4a2
tree05684e557787f713fbf9b514256891807914945e
parent21e27262edc6f5f090ea8915517ee867e30b9066
msg/Pipe: avoid creating empty out_q entry

We need to maintain the invariant that all sub queues in out_q are never
empty.  Fix discard_requeued_up_to() to avoid creating an entry unless we
know it is already present.

This bug leads to an incorrect reconnect attempt when

 - we accept a pipe (lossless peer)
 - they send some stuff, maybe
 - fault
 - we initiate reconnect, even tho we have nothing queued

In particular, we shouldn't reconnect because we aren't checking for
resets, and the fact that our out_seq is 0 while the peer's might be
something else entirely will trigger asserts later.

This fixes at least one source of #5626, and possibly #5517.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 9f1c27261811733f40acf759a72958c3689c8516)
src/msg/Pipe.cc