With 9G file, you could probably write a custom program to trace from the end of the chunk and eliminate good pages from the offending one making assumption either "pageLength" or "offset" write was off. Check format of the chunk header and read off the "next chunk" and start from there up. http://www.h2database.com/html/mvstore.html
Not sure if you can manually fix one chunk but I would be interested to know what to do in this case myself. P.S. Would format be more robust if pageLength, check are written twice (just like file header). That would waste 8 bytes per page but perhaps might provide a better chance for recovery later on. On Thursday, March 3, 2016 at 10:12:41 AM UTC-5, Matt Hicks wrote: > > I have a 9gig database file that was open when my Linux machine crashed > and rebooted and now I get the following when I try to load the database: > > [error] Caused by: java.lang.IllegalStateException: File corrupted in > chunk 1550574, expected page length 4..1024, got 1852517937 [1.4.191/6] > [error] at > org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773) > [error] at org.h2.mvstore.Page.read(Page.java:649) > [error] at org.h2.mvstore.Page.read(Page.java:195) > [error] at org.h2.mvstore.MVStore.readPage(MVStore.java:1939) > [error] at org.h2.mvstore.MVMap.readPage(MVMap.java:736) > [error] at org.h2.mvstore.Page.getChildPage(Page.java:217) > [error] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:468) > [error] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469) > [error] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469) > [error] at org.h2.mvstore.MVMap.get(MVMap.java:450) > [error] at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:954) > [error] at org.h2.mvstore.MVStore.getChunk(MVStore.java:931) > [error] at org.h2.mvstore.MVStore.readPage(MVStore.java:1930) > [error] at org.h2.mvstore.MVMap.readPage(MVMap.java:736) > > I have run `Recover` but it also crashes with this: > > [info] 2016.03.03 08:54:40:629 [main] ERROR t.n.c.NaboCloud$.main:38 - > java.lang.IllegalStateException: File corrupted in chunk 1550574, expected > page length 4..1024, got 1852517937 [1.4.191/6] > [info] at > org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773) > [info] at org.h2.mvstore.Page.read(Page.java:649) > [info] at org.h2.mvstore.Page.read(Page.java:195) > [info] at org.h2.mvstore.MVStore.readPage(MVStore.java:1939) > [info] at org.h2.mvstore.MVMap.readPage(MVMap.java:736) > [info] at org.h2.mvstore.Page.getChildPage(Page.java:217) > [info] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:468) > [info] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469) > [info] at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469) > [info] at org.h2.mvstore.MVMap.get(MVMap.java:450) > [info] at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:954) > [info] at org.h2.mvstore.MVStore.getChunk(MVStore.java:931) > [info] at org.h2.mvstore.MVStore.readPage(MVStore.java:1930) > [info] at org.h2.mvstore.MVMap.readPage(MVMap.java:736) > [info] at org.h2.mvstore.Page.getChildPage(Page.java:217) > > Is there anything I can do to recover the data? I've been using H2 in > production systems because it's faster than other SQL databases, but if > it's this easy to corrupt and lose data then I'm going to have to re-think > that. > > Any insights would be greatly appreciated. > > Thanks, > > Matt Hicks > OUTR Technologies, LLC > -- 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.
