Discussion Forums

re: Sequence reset
Ryan Pierce / Townsend Analytics Ltd. / Archipelago LLC
20 Jul 1998 5:52PM ET

> Hi
>
> Say you get a resend request for msgs from 8 to 16. You don't want to resend, but just reset the number.
>
> My understanding is that you can send a sequence reset message. The other side should NOT pay attention to the sequence number of the message. It says the next number should be twenty. The other side sets its session to expect message number 20 next, it does not expect the above messages to be resent.
>
> But at least one implementation expects gap fills from 8 to 16 and freaks if we do the above.

According to the FIX 4 spec, if you send a Sequence Reset-Reset, its MsgSeqNum is >= what they are expecting, and its NewSeqNum is > its MsgSeqNum, then the other side is required to increment their next expected sequence number forward, no questions asked, and they may not issue more Resend Requests to try to recover lost messages. Doing this generally should not break the other side.

If the MsgSeqNum of the Sequence Reset-Reset is < what they are expecting, even if NewSeqNum is > what they are expecting, then it's not so black and white. The other side may log you out, or may go ahead and process it, depending on which of two contradicting sections they believe takes precidence. So avoid that gray area if possible.

Still, I consider sending a Sequence Reset-Reset to 20 in response to a Resend Request from 8 to 16 to be dangerous. FIX 4 offers the Gap Fill capability for a reason - so you can explicitly state which messages you do not wish to retransmit, be it because they are Admin messages, or for business reasons such as changing markets. Sequence Reset-Gap Fills are required to be processed in order, so using them properly pretty much guarantees that no messages will be accidentally skipped. A Sequence Reset-Reset sidesteps all the protection built into the protocol, and there's a chance important messages might be skipped or lost.

Sequence Reset-Resets have their place. They're great for breaking out of an infinite retransmission loop. But as a general rule of thumb, in any code I write, only Sequence Reset-Gap Fills are generated automatically, and Sequence Reset-Resets can only be sent by a human operator in an emergency condition. Of course, your mileage may vary.


Sequence reset
Danny Shobrook / Apt Computer Systems Ltd   20 Jul 1998 4:27PM ET
re: Sequence reset
Ryan Pierce / Townsend Analytics Ltd. / Archipelago LLC   20 Jul 1998 5:52PM ET