I am using h2 1.4.196 in client server mode with the following options: MV_STORE=FALSE;MVCC=TRUE;LOCK_TIMEOUT=10000.
I've had this situation occur a couple times now, so getting a little concerned and wondering if anyone can provide any hints to the root cause. It's very concerning that I almost lost a bunch of data. In this case I just happened to have a backup from just earlier, but I don't think i'll always be this lucky. I am going to try and update to 1.4.199 to see if that might help, but would really appreciate any other tips anyone might have to prevent this issue. Every night I do a database backup, my steps are: 1. shutdown the application/web tier 2. run a backup using org.h2.tools.Script 3. startup the web tier Last night I noticed the following: 1. about 15 minutes after the backup i start noticing: > [ERROR] 2019-03-15 22:15:23,946 > org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions - General > error: "java.lang.RuntimeException: page[66187] data leaf table:129 NOTE > entries:20 parent:23460 keys:[265341, 265342, 265343, 265344, 265345, > 265346, 265347, 265348, 265349, 265350, 265351, 265352, 265353, 265354, > 265355, 265357, 265358, 265359, 265360, 265361] offsets:[4022, 3911, 3805, > 3709, 3613, 3489, 3375, 3266, 3134, 2937, 2799, 2687, 2528, 2406, 2288, > 2194, 2073, 1971, 1855, 1689] parent 23460 expected 41560"; SQL > statement:..... 2. 30 minutes after I see "2019-03-15 10:39:59 pageStore: Transaction log could not be truncated; size: 30 MB" in the trace file. I've read some other forum posts on this, not sure if it's related, but either way the links to increase the logsize were broken, so if you think it's relevant please let me know. To recover, I had to run the recovery tool which created the sql file fine, but unfortunately importing the sql file via runscript resulted in the below error. So unfortunately I had to restore from backup. > h2@61bbe7dbcacf:/opt/h2-data$ java -cp /opt/h2/bin/h2*.jar > org.h2.tools.RunScript -url "jdbc:h2:./database;MV_STORE=FALSE" -script > db.h2.sql > Exception in thread "main" org.h2.jdbc.JdbcSQLException: Unique index or > primary key violation: "PRIMARY_KEY_23 ON PUBLIC.TICKET_DETAIL(ID) VALUES ( > /* 256717 */ 318631 )"; SQL statement: > CREATE PRIMARY KEY PUBLIC.PRIMARY_KEY_23 ON PUBLIC.TICKET_DETAIL(ID) > [23505-196] > at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) > at org.h2.message.DbException.get(DbException.java:179) > at org.h2.message.DbException.get(DbException.java:155) > at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103) > at org.h2.index.PageBtree.find(PageBtree.java:120) > at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:149) > at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:102) > at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:205) > at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:205) > at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:97) > at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:88) > at org.h2.table.RegularTable.addRowsToIndex(RegularTable.java:352) > at org.h2.table.RegularTable.addIndex(RegularTable.java:281) > at org.h2.command.ddl.CreateIndex.update(CreateIndex.java:107) > at org.h2.command.CommandContainer.update(CommandContainer.java:101) > at org.h2.command.Command.executeUpdate(Command.java:260) > at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:192) > at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:164) > at org.h2.tools.RunScript.process(RunScript.java:261) > at org.h2.tools.RunScript.process(RunScript.java:191) > at org.h2.tools.RunScript.process(RunScript.java:329) > at org.h2.tools.RunScript.runTool(RunScript.java:142) -- 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 https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
