GapFill / SequenceRest

Imported from previous forum

[ original email was from Nick Kopan - nkopan@attain.com ]
Do most Exchanges (Sell sides) allow SequenceReset messages where the GapFillFlag=‘N’? This “blind resequencing” brings up the possibility of data loss, since the following could happen:

Client sends SeqNo=400

Client goes down for some reason

Client sends SeqNo=410
Exchange sends ResendRequest, BeginSeqNo=401
Client sends SeqNo=401, NewOrderSingle
Client sends SeqNo=402, SequenceReset, GapFillFlag=‘N’, NewSeqNo=411

In this scenario, if the exchange does not receive Client SeqNo=401, it will never receive it, and it will not resequence.

This suggests that GapFillFlag=‘N’ should not be supported to prevent data loss? However, many exchanges do accept this, and many applications do send it.

Looking at FIX 4.1:

"If the GapFill field is not present (or set to N), it can be assumed that the purpose of the sequence reset message is to recover from an out-of-sequence condition. The MsgSeqNum in the header should be ignored (i.e., the receipt of a sequence reset message with an out of sequence MsgSeqNum should not generate resend requests)."

So it LOOKS like Client msg 402 will be processed and sequence number set to 411 even if 401 was not received; thus 401 is lost.

Is this an accurate description of the data loss you refer to?


Aaron Stokes
Consultant, Financial Services
Headstrong (Japan) Ltd
aaron.stokes@headstrong.com

> Do most Exchanges (Sell sides) allow SequenceReset messages where the GapFillFlag=‘N’? This “blind resequencing” brings up the possibility of data loss, since the following could happen:
>
> Client sends SeqNo=400
>
> Client goes down for some reason
>
> Client sends SeqNo=410
> Exchange sends ResendRequest, BeginSeqNo=401
> Client sends SeqNo=401, NewOrderSingle
> Client sends SeqNo=402, SequenceReset, GapFillFlag=‘N’, NewSeqNo=411
>
> In this scenario, if the exchange does not receive Client SeqNo=401, it will never receive it, and it will not resequence.
>
> This suggests that GapFillFlag=‘N’ should not be supported to prevent data loss? However, many exchanges do accept this, and many applications do send it.
>

[ original email was from Ryan Pierce - rpierce@taltrade.com ]
> Looking at FIX 4.1:
>
> "If the GapFill field is not present (or set to N), it can be assumed that the purpose of the sequence reset message is to recover from an out-of-sequence condition. The MsgSeqNum in the header should be ignored (i.e., the receipt of a sequence reset message with an out of sequence MsgSeqNum should not generate resend requests)."
>
> So it LOOKS like Client msg 402 will be processed and sequence number set to 411 even if 401 was not received; thus 401 is lost.
>
> Is this an accurate description of the data loss you refer to?

I believe this is indeed the problem scenario they are describing.

The original question asked which exchanges, ECNs, etc. support this. Archipelago does support SeqReset - Reset, however we actively discourage our customers from using it, and strongly recommend that they send SeqReset - Gap Fill instead. I believe our automated client certification system will test the client on this, and will issue a warning (but will not fail the client) if the client responds to Resend Requests with SeqReset - Reset.

It is my belief that SeqReset - Reset does have its uses, hence I think that both buy and sell side systems should be required to support receiving it. It is useful in the case of a major sequencing failure for an operator to trigger a SeqReset - Reset to recover, with the understanding that messages may be lost and must be reconciled by hand. But using SeqReset - Reset instead of a Gap Fill as an automated response to a Resend Request is, in my view, a very poor business practice due to the possibility of message loss. Hence I think a firm may reasonably say that while they will accept SeqReset - Reset to recover from unusual conditions, they will refuse to do business with anyone who does not send SeqReset - Gap Fill for normal Resend Request processing.

Note also that the FIX 4.2 errata added to the spec:

"Sequence Reset – Reset should NOT be used as a normal response to a Resend Request (use Sequence Reset – Gap Fill). Sequence Reset – Reset should ONLY be used to recover from a disaster situation which cannot be recovered via the use of Sequence Reset – Gap Fill. Note that the use of Sequence Reset – Reset may result in the possibility of lost messages."