[ts-gen] Debugging intermittent lost posts [Was: Do I really need to ...]

Nils Gebhardt mail at ngebhardt.de
Tue Sep 22 16:58:47 EDT 2009






Bill, 

I followed your suggestions and found the following: 



On Mon, 2009-09-14 at 19:34 -0400, Bill Pippin wrote: 
Nils,
> 
> About losing order status posts:
> 
> > ... I am [intermittently losing posts for] ... records in the
> > OrderStatus table which are present in the shim log. 
> 
> [...]

you could print out the query
> text variable "q" in the ctor body:
> 
> 69:  env::PerQuery
> 70:     ::PerQuery(Msql_1 m, char_0 q)
> 71:         : dbms(m),
> 72:           conn(m.conn),
> 73:           text(m.text),
> 74:          query(q),
> 75:         status(       mysql_query(conn, query)    ),
> 76:         insert(self ? mysql_insert_id(   conn) : 0),
> 77:         result(self ? mysql_store_result(conn) : 0),
> 78:          width(self ? mysql_field_count( conn) : 0),
> 79:    store_fault(width && !result)
> 80:  {}
> // insert fprintf(stderr, "PerQ: %s\n", q); in ctor body above
> 
I started with the last one and got in the output somewhere a insert
statment, in a test case example 

PerQ: insert ignore
  into OrderStatus(
acc, perm, client_id, order_tag, parent_id, status, filled, remaining,
avg_fill, last_fill)
values
(1, 891837411, 8, 1251, 0, 'Submitted', 0, 2, 0.0000, 0.0000);

---%-- 

the actual result was missing in the OrderStatus table. I feeded 
the same statement into an mysql session and recieved, after removing
the 'ignore' attribut, the following error message: 

ERROR 1062 (23000) at line 1: Duplicate entry '1-8-1251-Submitted-0-2'
for key 3

I remember order_tag, acc and client_id should form a key, but in deed -
the values from above are already taken in OrderStatus by a former, 
different order. 
However, I have no idea how to fix it. Might it be the case that
order_tag is only unique for a (or a few) day(s) and then cycles back?

By the way, the standard error of shim remained empty and didn't
complain about anything - might it be that this is a consequence 
of the 'ignore' attribute? 

regards 


Nils




More information about the ts-general mailing list