Hi,

I'm not sure, but I feel like COPY INTO is a low level tool, bypassing transactions...
It is described as BULK copy !

That said, I might be wrong.

Franck


Le 13/06/2013 14:10, Roberto Cornacchia a écrit :
Hi there, 
I'm trying to chase the cause of a problem with concurrent reads/writes, that shows up as either a "COMMIT FAILED" error or an assertion (delta_append_bat: Assertion `!c || ((c)->U->count) == bat->ibase' failed), probably depending timing issues.

The scenario is roughly: two threads, one reading, one writing. Sometimes, they need to read/write from/to the same table. I'm aware that this may raise issues, but I'd like to get straight what the real cause is (and possibly what the cause of the assertion is).

Imagine two JDBC connections, R (read only) and W (write only), in the following timeline:


TS = transaction start
TC = transaction commit
TR = transaction trollback
CO = cursor open
C++ = increment cursor (read one row)
IN = insert


    R  |  W
_______________
1|     | TS   
2| TS  |
3| CO  | IN
4| C++ |
5|     | TC
6|     | TS
6| C++ | IN
7| TR  | 
8|     | TC


The question is: is this supposed to fail or to succeed? 
There are no UPDATE in W, only INSERT INTO (actually COPY INTO).

I tried a similar scenario with 2 mclient sessions, continuously reading from R (without cursors) and writing and committing from W.
R kept nicely showing no updates, until the ROLLBACK. Then, it showed the updates from W.

But I'm not sure whether the scenario above with cursors should behave the same.

This is using very up to date Feb2013 branch. I guess the assertion is a bug, and I'd like to file it, but at the moment it's quite hard to reproduce consistently, perhaps it would be easier if I could get a better understanding of the scenario above.
Thanks, Roberto


_______________________________________________
users-list mailing list
users-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/users-list