Corruption errors with new 1.4 branch

282 views
Skip to first unread message

Rami Ojares

unread,
Sep 10, 2014, 3:53:16 AM9/10/14
to h2-da...@googlegroups.com
Hi

I have been using some weeks now the 1.4 branch in my development
environment.

MV_STORE has been on (I assume this based on filename .mv.db)
MVCC has been off (does this make sense?)
MULTI_THREADED has been on.

Every now and then the database becomes corrupted.

I will turn now MULTI_THREADED off and MVCC on and see how that goes.
I will report about my experiences in few weeks.

The latest error message was:

Exception in thread "main" org.h2.jdbc.JdbcSQLException: General error:
"java.lang.IllegalStateException: Chunk 117176 not found [1.4.181/6]"
[50000-181]
at
org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.engine.Database.openDatabase(Database.java:297)
at org.h2.engine.Database.<init>(Database.java:260)
at org.h2.engine.Engine.openSession(Engine.java:60)
at org.h2.engine.Engine.openSession(Engine.java:167)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:145)
at org.h2.engine.Engine.createSession(Engine.java:128)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:149)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Chunk 117176 not found
[1.4.181/6]
at
org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:762)
at org.h2.mvstore.MVStore.getChunk(MVStore.java:847)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1795)
at org.h2.mvstore.MVMap.readPage(MVMap.java:769)
at org.h2.mvstore.MVMap.setRootPos(MVMap.java:779)
at org.h2.mvstore.MVStore.openMap(MVStore.java:449)
at
org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:370)
at
org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:729)
at
org.h2.mvstore.db.MVSecondaryIndex.<init>(MVSecondaryIndex.java:71)
at org.h2.mvstore.db.MVTable.addIndex(MVTable.java:419)
at org.h2.command.ddl.CreateIndex.update(CreateIndex.java:94)
at org.h2.engine.MetaRecord.execute(MetaRecord.java:58)
at org.h2.engine.Database.open(Database.java:732)
at org.h2.engine.Database.openDatabase(Database.java:266)
... 7 more

at org.h2.engine.SessionRemote.done(SessionRemote.java:622)
at
org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:141)
at
org.h2.engine.SessionRemote.connectServer(SessionRemote.java:446)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:327)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:108)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:92)
at org.h2.Driver.connect(Driver.java:72)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at org.h2.tools.Shell.runTool(Shell.java:146)
at org.h2.tools.Shell.main(Shell.java:79)

Noel Grandin

unread,
Sep 10, 2014, 4:37:03 AM9/10/14
to h2-da...@googlegroups.com
MULTI_THREADED is still experimental.

Rami Ojares

unread,
Sep 10, 2014, 7:01:11 AM9/10/14
to h2-da...@googlegroups.com
I thought it was only experimental together with MVCC.

- rami

Thomas Mueller

unread,
Sep 10, 2014, 7:10:35 AM9/10/14
to h2-da...@googlegroups.com
Hi,

Do you have a reproducible test case?

For version 1.4.x, I was hoping both multi-threaded and MVCC can be supported (even combined).

Regards,
Thomas
--
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 h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Rami Ojares

unread,
Sep 10, 2014, 7:37:34 AM9/10/14
to h2-da...@googlegroups.com
Unfortunately I do not have one.
I can only describe in broad terms what I do.
I keep on generating tables, views etc. Importing data, doing some changes, destroying everything, regenerating...
I do this inside vmware virtual machine that I shutdown normally, move to another machine and so on.

Every now and then when trying to open the database I get some corruption error.
That's all I can tell you I'm afraid.

- Rami

Thomas Mueller

unread,
Sep 11, 2014, 1:47:15 AM9/11/14
to h2-da...@googlegroups.com
Hi,

Do you have a reproducible test case?

Regards,
Thomas


On Wednesday, September 10, 2014, Noel Grandin <noelg...@gmail.com> wrote:

Rami Ojares

unread,
Sep 14, 2014, 9:40:10 PM9/14/14
to h2-da...@googlegroups.com
I got the corruption error again. This time with MVCC and no MULTI_THREADED.
The stuff I was doing was redeploying my own custom classes and stopping and starting h2 server.
The way I stop h2 is to send SIGTERM to the jvm process.
I was wondering if it could have something to do with that.
Eg. starting a new h2 process before the previous one has completed doing the shutdown.
Does the previous process keep the db file locked long enough so the next process can not mess with it?
Or could the problem lie with deploying new custom classes.

Here's the exception (the same Chunk missing issue as before)

Exception in thread "main" org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: Chunk 10751 not found [1.4.181/6]" [50000-181]

        at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.message.DbException.convert(DbException.java:295)
        at org.h2.engine.Database.openDatabase(Database.java:297)
        at org.h2.engine.Database.<init>(Database.java:260)
        at org.h2.engine.Engine.openSession(Engine.java:60)
        at org.h2.engine.Engine.openSession(Engine.java:167)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:145)
        at org.h2.engine.Engine.createSession(Engine.java:128)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:149)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Chunk 10751 not found [1.4.181/6]

        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:762)
        at org.h2.mvstore.MVStore.getChunk(MVStore.java:847)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1795)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:769)
        at org.h2.mvstore.MVMap.setRootPos(MVMap.java:779)
        at org.h2.mvstore.MVStore.openMap(MVStore.java:449)
        at org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:375)
        at org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:729)
        at org.h2.mvstore.db.MVPrimaryIndex.<init>(MVPrimaryIndex.java:74)
        at org.h2.mvstore.db.MVTable.init(MVTable.java:88)
        at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:129)
        at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:41)
        at org.h2.schema.Schema.createTable(Schema.java:582)
        at org.h2.command.ddl.CreateTable.update(CreateTable.java:137)

        at org.h2.engine.MetaRecord.execute(MetaRecord.java:58)
        at org.h2.engine.Database.open(Database.java:732)
        at org.h2.engine.Database.openDatabase(Database.java:266)
        ... 7 more



Vitali Diatchkov

unread,
Sep 15, 2014, 3:38:52 AM9/15/14
to h2-da...@googlegroups.com

I  am observing  similar  issue with lost chunks. See my post about BLOBs  at 13.09.2014.  Randomly in multi-threaded environment and MVStore  enabled  the database  becomes corrupted.

Thomas Mueller

unread,
Sep 15, 2014, 3:55:41 AM9/15/14
to H2 Google Group
Hi,

Could you provide a reproducible test case? If not, I would need to have a more detailed description on the operations that were run.

Regards,
Thomas



On Mon, Sep 15, 2014 at 9:38 AM, Vitali Diatchkov <vit...@gmail.com> wrote:

I  am observing  similar  issue with lost chunks. See my post about BLOBs  at 13.09.2014.  Randomly in multi-threaded environment and MVStore  enabled  the database  becomes corrupted.

--

Vitali

unread,
Sep 16, 2014, 8:26:33 AM9/16/14
to h2-da...@googlegroups.com
Usually  everything starts with
Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed; SQL statement:

exception  on INSERT or UPDATE query where BLOB type is taking part.

UPDATE "X"."A" SET "TYYPPI" = ?,"ITEMID" = ?,"SHAPE" = ?  WHERE ("A_ID" = ?) [90007-181]
    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.message.DbException.get(DbException.java:144)
    at org.h2.store.LobStorageMap.createBlob(LobStorageMap.java:128)
    at org.h2.value.ValueLobDb.link(ValueLobDb.java:254)
    at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:120)
    at org.h2.mvstore.db.MVTable.addRow(MVTable.java:620)
    at org.h2.table.Table.updateRows(Table.java:466)
    at org.h2.command.dml.Update.update(Update.java:145)
    at org.h2.command.CommandContainer.update(CommandContainer.java:78)
    at org.h2.command.Command.executeUpdate(Command.java:254)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198)
    at org.geotools.jdbc.JDBCDataStore.update(JDBCDataStore.java:1570)


looks like something happens with BLOB's  InputStream that is closed before it should be used..

Currently with high probability of exceptions  I get this problem in  INSERT...SELECT..   queries where BLOBs are as well.

Vitali.

Thomas Mueller

unread,
Sep 17, 2014, 2:54:21 AM9/17/14
to h2-da...@googlegroups.com
Hi,

What database URL do you use?

Regards,
Thomas

Thomas Mueller

unread,
Sep 17, 2014, 2:54:21 AM9/17/14
to h2-da...@googlegroups.com
Hi,

I will try to improve the error message / stack trace, but maybe the "object is already closed" is unrelated to the other problem ("Chunk ... not found").

If you have a reproducible test case, that would be great. Or a database you can send me, so I can reproduce it.

Regards,
Thomas

Vitali

unread,
Sep 17, 2014, 11:54:07 AM9/17/14
to h2-da...@googlegroups.com
Hello, Thomas.

I prepare some test case for you in coming days.

Vitali.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages