BUG-8402: Separate out OutOfOrderRequestException
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>
(cherry picked from commit
d02d60083ee163cf465c265364c21c0df9cdc3c7)