Hi, I found and fixed one of the problems. There is one problem remaining: you can get a lock timeout quite easily. This is a bug: locking and unlocking are incorrectly synchronized. Basically, a session that wants to lock a table can block the other session to unlock the same table, which will always result in a lock timeout. I'm now working on this issue.
Regards, Thomas On Tuesday, September 30, 2014, Thomas Mueller <[email protected]> wrote: > Hi, > > Thanks a lot for the test case! I can reproduce the below exception with > your test case. I'm investigating now. > > Caused by: java.lang.RuntimeException: Unexpected code path > at org.h2.message.DbException.throwInternalError(DbException.java:242) > at org.h2.message.DbException.throwInternalError(DbException.java:255) > at org.h2.engine.Database.checkMetaFree(Database.java:1404) > at org.h2.engine.Database.removeMeta(Database.java:915) > at org.h2.engine.Database.updateMeta(Database.java:1574) > at org.h2.command.ddl.Analyze.analyzeTable(Analyze.java:125) > at org.h2.mvstore.db.MVTable.analyzeIfRequired(MVTable.java:654) > at org.h2.mvstore.db.MVTable.addRow(MVTable.java:641) > at org.h2.command.dml.Insert.insertRows(Insert.java:156) > at org.h2.command.dml.Insert.update(Insert.java:114) > > Regards, > Thomas > > > On Monday, September 29, 2014, Viktor Voytovych <[email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > >> It does crash even without the "LOG=0;UNDO_LOG=0" stuff. If you run the >> test a few times you might see a few different exceptions. I can provide >> you the output but it would be more efficiently if you could run the test >> on your hardware. >> >> Viktor >> >> On Monday, September 29, 2014 12:43:28 PM UTC+3, Noel Grandin wrote: >>> >>> >>> >>> On 2014-09-29 10:17 AM, Viktor Voytovych wrote: >>> > Hello, >>> > >>> > MULTI_THREADED=0 fixed the issue for me but it's not what I >>> expected... What exactly MULTI_THREADED=1 does? Is there any >>> > good explanation posted? Does it really means that H2 is not multi >>> threaded by default? Would all 32 CPU cores be used >>> > under heavy load? >>> > >>> >>> By default we have a single big lock around the stuff that actually >>> modifies the database. But the result-set processing >>> is still multi-threaded in this mode. >>> In MULTI_THREADED=1 mode, we attempt to use more fine-grained >>> synchronization, but as you noticed, there are still >>> problems there. >>> >>> > I've created a requested small test case (see attached >>> H2MultiThreadedTester.java; required dependencies are h2database >>> > v.1.4.181 and commons-pool v.1.6). It runs great in case if >>> MULTI_THREADED=0. For MULTI_THREADED=1 it throws different >>> > kinds of exceptions. >>> > Let me know if you have any questions regarding the test case. >>> >>> Does it still crash if you remove the "LOG=0;UNDO_LOG=0" stuff? Because >>> in general I don't care about debugging problems >>> with those options because they're only intended for testing, not for >>> production use. >>> >>> -- Noel >>> >> >> The information in this message may be confidential. It is intended >> solely for >> the addressee(s). If you are not the intended recipient, any disclosure, >> copying or distribution of the message, or any action or omission taken >> by you >> in reliance on it, is prohibited and may be unlawful. Please immediately >> contact the sender if you have received this message in error. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "H2 Database" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/h2-database. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
