tags:

views:

58

answers:

2

I am using quickfix 1.13.3 recompiled with ODBC and I have a strange behavior on my acceptors (two acceptors on different machines sharing the same ODBC database and enabled for hot failover). My daily session is setup with:

RefreshOnLogon=Y
StartTime=00:02:00
EndTime=23:58:00
PersistMessages=Y

and the necessary Odbc Settings.

At 23:54, the initiator sends a Logout with MsgSeqNum = 1711, my quickfix acceptor responds with Logout MsgSeqNum = 1711, so no problem there.

At 00:05:16, the initiator sends a Logon with MsgSeqNum = 2, but my quickfix acceptor responds with Logout MsgSeqNum = 1712 !

At 00:05:18, the initiator retries with Logon and MsgSeqNumm = 4, and this time, my quickfix acceptor responds with Logon MsgSeqNum = 1

Thinking that maybe, in the table "sessions", the incoming_seqnum and outgoing_seqnum were not properly reset by ODBC, I even tried to force a reset manually at 00:00 but in vain, I still get the same behavior.

My guess at the moment is that quickfix with this configuration still matches the Logon request against the yesterday session which results in the logout with the yesterday sequence number....

With the same StartTime, EndTime, 1 acceptor (instead of two), FileStore, and no RefreshOnLogon setting (because I had only 1 acceptor) it used to work with quickfix 1.12.4.

I also tried with RefreshOnLogon=N but the problem remains the same... seqnums are not properly reset at midnight.

Any ideas?

Many thanks,

A: 

When your session starts, quickfix looks into the seqnum files which it has created during the previous sessions. When you session starts up, the acceptor has not cleared up its previous seqnum logs. So it reads from the old logs and wants that sequence number.

After only it sees the sequence reset or log on connection from your initiator side, does it cleans up its old sequence numbers. Remember the flag is RefreshOnLogon=Y, no logon incident has happened till now, so old seqnums still exist. It maybe worthwhile that you manually delete your old seqnum files as your acceptor starts up.

DumbCoder
Hi, in my case seqnums are stored in a shared database. At first that's what I thought, so I forced seqnums in the database with an seqnum update 1 - 1 at midnight, but the problem is still the same. Should I set RefreshOnLogon=N? In that case, will the failover still work (the initiator switches automatically from an acceptor to another on failure). Thanks.
Idriss
If RefreshOnLogon=N -> If you receive the incorrect sequence number, the initiator would send across the sequence number in the reject logon message. Your client would then use that sequence number to start once more again an all should be fine. So cleaning up the seqnums mayn't be a good idea for you if you have switchover mechanisms. And I am not sure if seqnum should be 0 on start or 1.
DumbCoder
+1  A: 

After many attempts with the different settings, I finally rollbacked to 1.12.4 recompiled with ODBC. With the same settings, the old library works properly and seqnums are properly reset at 00:02:00.

RefreshOnLogon=Y
StartTime=00:02:00
EndTime=23:58:00
PersistMessages=Y
Idriss