Error reading existing databases with H2 trunk

321 views
Skip to first unread message

Silvio

unread,
Jun 13, 2023, 5:45:10 AM6/13/23
to H2 Database
Hello all,

I created a H2 test build from current trunk. Using this on a bunch of databases created with 2.1.214 I get the following error on a rather large part of them:

org.h2.mvstore.MVStoreException: File is corrupted - unable to recover a valid set of chunks [2.2.219/6]

When reverting to 2.1.214 the problem disappears.

Do databases have to be dumped/restored for this to work properly? Or is 2.2.219 supposed to be able to use databases created with 2.1.214?


Andrei Tokar

unread,
Jun 16, 2023, 9:49:12 AM6/16/23
to H2 Database
Hi Silvio,
SQL dump / restore is the only supported way to transition from one version to the other.
We are making our best trying to preserve compatibility with older db files, but again, it's on a "best effort" basis.
Forward compatibility is totaly out of question.
And that's I've been talking about released versions. Jumping onto unreleased version is totally "leap of faith", should be no expectations about switching back, or compatibility with future released version. SQL dump/restore should work most of the time though.

Silvio

unread,
Jun 23, 2023, 7:50:21 AM6/23/23
to H2 Database
Hi Andrei,

Yes, that is what I was expecting. Makes perfect sense of course.

SQL dump/restore broke when going from 1.4.x to 2.x.x and we found no way to work around that. We came up with our own dump/restore format that only reuses the DDL part of the old database which seemed to be compatible accross versions and uses CSV for the data. As long as the DDL matches we should be fine there.

We where not planning of jumping onto an unreleased version. Actually it is quite the opposite since we are only allowed to use released versions.

But I read some thing about improvements that I was curious about and decided to give it a try on a test server. I guess we will just have to wait for the next release.
Reply all
Reply to author
Forward
0 new messages