H2 Corrupted database v1.4.189

263 views
Skip to first unread message

Rachid OURIHC

unread,
Aug 19, 2016, 11:57:14 AM8/19/16
to H2 Database

Hi everyone,

We are encountering recurring data corruption in one of our products using H2 as database. Until now we got 2 corrupted databases; and our application will be installed in more than 20 machines.
- The version of H2 is 1.4.189 with hibernate+ JPA
- The database schema is composed of 62 
small tables without binaries.

- Database url is the following

       jdbc:h2:file:C:/Storage/MDBASE;MVCC=TRUE;MV_STORE=TRUE;AUTO_SERVER=TRUE;CACHE_SIZE=16384

- Backuping the corrupted database gives the following error : 
               Exception in thread "main" java.lang.IllegalStateException: File corrupted in chunk 13439, expected page length 4..32, got -486539227 [1.4.191/6]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
        at org.h2.mvstore.Page.read(Page.java:649)
        at org.h2.mvstore.Page.read(Page.java:195)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1939)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
        at org.h2.mvstore.Page.getChildPage(Page.java:217)
        at org.h2.mvstore.Cursor.fetchNext(Cursor.java:150)
        at org.h2.mvstore.Cursor.next(Cursor.java:50)
        at org.h2.mvstore.MVMap$2$1.next(MVMap.java:879)
        at org.h2.mvstore.MVMap$2$1.next(MVMap.java:870)
        at org.h2.tools.Recover.dumpLobMaps(Recover.java:701)
        at org.h2.tools.Recover.dumpMVStoreFile(Recover.java:603)
        at org.h2.tools.Recover.process(Recover.java:345)
        at org.h2.tools.Recover.runTool(Recover.java:196)
        at org.h2.tools.Recover.main(Recover.java:159)
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc."
 
I cannot provide an example of a corrupted database, since I cannot reproduce the issue, and the data we manage is really sensitive...

 

Do you have an idea what will be the cause of these crashes ? How it is possible to recover these databases ?

Any pointer or insight would be greatly appreciated,
Thanks

Steve McLeod

unread,
Aug 20, 2016, 1:12:09 PM8/20/16
to H2 Database
You are using a version of H2 (1.4.189) that was clearly marked as beta. The most recent stable release is 1.3.176.

In my opinion, you should be using 1.3.176 for production.

If you really insist on using the latest beta, then you should use the page store, and not the MV store.  Do this by appending MV_STORE=false to the JDBC URL.

Rachid OURICH

unread,
Aug 22, 2016, 4:23:44 AM8/22/16
to h2-da...@googlegroups.com
Thank you ,
Does this mean that MV STORE is not stable enough ? and it is the cause of the database corruption ?
what are the side impacts of disabling MV STORE? knowing that we are in a multi threaded application. 

--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/vytfkUIeWIs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database+unsubscribe@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Steve McLeod

unread,
Aug 23, 2016, 4:09:32 AM8/23/16
to H2 Database
I think it is clear that version 1.4 is not marked as stable. 

It is is impossible to tell the cause of a database corruption without a full investigation.

what are the side impacts of disabling MV STORE? knowing that we are in a multi-threaded application. 

You'd need to assess that yourself, I'm afraid. 
To unsubscribe from this group and all its topics, send an email to h2-database...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages