Out of sequence while gap filling

Imported from previous forum

[ original email was from Domenico Betunio - betunio@bancaimi.it ]
Scenario:

1 A: …> Logon
2 B: <… Logon
3 A: …> Resend Request (from 10 to 9999999)
4 B: <… GapFill with NewSeqNo = 14 and MsggSeqNum=10
5 B: <… send MsgSeqNum 14 and PossDupFlag=Y
6 B: <… send MsgSeqNum 19 and PossDupFlag=N
7 B: <… send MsgSeqNum 15 and PossDupFlag=Y

B is sending a message out of sequence (step 6) while replying to ResendRequest: should B queue the msgno 19 and perform the gap fill first or should A queue the message since it is not duplicated? If A requests messages from 10 to infinit is it correct to reply with all the messages in the range mixing old and new ones.

What happens in the given scenario is that A simply discards msgno 19 (step 6), without notifying B in any way: is this appropriate?

Thanks
Domenico

[ original email was from Ryan Pierce - rpierce@taltrade.com ]
> Scenario:
>
> 1 A: …> Logon
> 2 B: <… Logon
> 3 A: …> Resend Request (from 10 to 9999999)
> 4 B: <… GapFill with NewSeqNo = 14 and MsggSeqNum=10
> 5 B: <… send MsgSeqNum 14 and PossDupFlag=Y
> 6 B: <… send MsgSeqNum 19 and PossDupFlag=N
> 7 B: <… send MsgSeqNum 15 and PossDupFlag=Y
>
> B is sending a message out of sequence (step 6) while replying to ResendRequest: should B queue the msgno 19 and perform the gap fill first or should A queue the message since it is not duplicated? If A requests messages from 10 to infinit is it correct to reply with all the messages in the range mixing old and new ones.

In this case, B should consider responding to the Resend Request as an atomic operation. B shouldn’t be generating and sending new messages (19) until it has finished resending or gap filling over all messages prior to 19.

A might be able to recover from this scenario. A should, upon seeing 19, toss it out (I’m assuming it is a business message and not one of the special admin messages that FIX defines should be processed regardless of sequence number error) and send a Resend Request asking for 15 - Infinity. This will result in much less efficient recovery as a lot of unnecessary messages will be resent. If B keeps interjecting new messages among the resent messages, that could trigger yet more Resend Requests and make recovery virtually impossible.

> What happens in the given scenario is that A simply discards msgno 19 (step 6), without notifying B in any way: is this appropriate?

A needs to notify B with a Resend Request to be compliant with the protocol. You can’t just throw away 19.