BUG-8402: Separate out OutOfOrderRequestException 89/57289/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 17 May 2017 14:19:04 +0000 (16:19 +0200)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 18 May 2017 15:12:32 +0000 (15:12 +0000)
OutOfOrderRequestException is used for two distinct cases, which is
a mixup during refactor.

The first case is when an envelope's sequence does not match the
sequence we are expecting on a connection. This is a retriable
exception and happens due to mailbox queueing during leadership
changes:
- a FE sees us as a leader, sends requests
- we become a follower, we reject a few requests
- we become a leader, at which point we must not process requests
  until the FE reconnects, as we would not be processing them in
  the correct order.

The second case is when we receive a Request with an unexpected
sequence. This is a hard error, as it indicates that the client
has made a mistake and lost a request (like the case fixed in
fe69101801085580f2fe72762abea5c5fa83d978).

Separate these two cases out by introducing
OutOfSequenceEnvelopeException and handle it by initiating a session
reconnect.

Change-Id: Ifb0bac41ff2efd6385455fd9c77b8b39054dd4a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

No differences found