I am running h2 1.4.196 in client server mode with the following parameters: MV_STORE=FALSE;MVCC=TRUE;LOCK_TIMEOUT=10000
I've seen this similar issue a couple times now and it's becoming a problem so wondering if anyone has any suggestions on how to prevent? I am going to upgrade to 1.4.199 but wondering if there is something else. Would really appreciate any advice on preventing this situation Nightly I : 1. shutdown the web tier 2. backup the database using org.h2.tools.Script 3. restart the web tier about 15 minutes after the backup I started seeing the following exception in the logs: > [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: > select ... 30 minutes after I also noticed the following in the trace log: 2019-03-15 10:39:59 pageStore: Transaction log could not be truncated; size: 30 MB I don't think this is related, but posting in case. I saw some relavant posts but they refered to some broken links to increase the page store size. if you think it's relevant please share how to increase. so.. database is corrupt, ok well i'll just recover it. 1. run org.h2.tools.Recover without issues, creates the sql file 2. unfortunately using RunScript, it dies with the following error, so unfortunately I had to restore from backup. > java -cp /opt/h2/bin/h2*.jar org.h2.tools.RunScript -url > "jdbc:h2:./database;MV_STORE=FALSE" -script database.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) > at org.h2.tools.RunScript.main(RunScript.java:69) -- 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.
