Skip to content

java.lang.IllegalStateException: Chunk XXX not found [1.4.200/9] on index creation #2590

@wf-r

Description

@wf-r

Hi,

I am using H2 1.4.200 in Scala to concurrently save computation results (with HikariCP used as connection pool), after which I would like to create indexes. This (randomly) crashes with the following stacktrace:

Caused by: org.h2.jdbc.JdbcSQLNonTransientException: Allgemeiner Fehler: "java.lang.IllegalStateException: Chunk 103 not found [1.4.200/9]"
General error: "java.lang.IllegalStateException: Chunk 103 not found [1.4.200/9]"; SQL statement:
CREATE PRIMARY KEY ON "TABLENAME" ( "COLUMN1","COLUMN2" ); [50000-200]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
	at org.h2.message.DbException.get(DbException.java:194)
	at org.h2.message.DbException.convert(DbException.java:347)
	at org.h2.command.Command.executeUpdate(Command.java:259)
	at org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:168)
	at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:126)
	at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)
	at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
	at <my code>
	... 43 common frames omitted
Caused by: java.lang.IllegalStateException: Chunk 103 not found [1.4.200/9]
	at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950)
	at org.h2.mvstore.MVStore.getChunk(MVStore.java:1230)
	at org.h2.mvstore.MVStore.readBufferForPage(MVStore.java:1214)
	at org.h2.mvstore.MVStore.readPage(MVStore.java:2209)
	at org.h2.mvstore.MVMap.readPage(MVMap.java:672)
	at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1043)
	at org.h2.mvstore.Cursor.hasNext(Cursor.java:53)
	at org.h2.mvstore.tx.TransactionMap$CommittedIterator.fetchNext(TransactionMap.java:779)
	at org.h2.mvstore.tx.TransactionMap$TMIterator.next(TransactionMap.java:952)
	at org.h2.mvstore.db.MVPrimaryIndex$MVStoreCursor.next(MVPrimaryIndex.java:469)
	at org.h2.mvstore.db.MVTable.rebuildIndexBlockMerge(MVTable.java:434)
	at org.h2.mvstore.db.MVTable.rebuildIndex(MVTable.java:393)
	at org.h2.mvstore.db.MVTable.addIndex(MVTable.java:370)
	at org.h2.command.ddl.CreateIndex.update(CreateIndex.java:107)
	at org.h2.command.CommandContainer.update(CommandContainer.java:198)
	at org.h2.command.Command.executeUpdate(Command.java:251)
	... 58 common frames omitted

The table it tries to create the index on is the largest in the database, at approximately 9-10 million rows, the database in total is at approx. 750MB.

The connection string is jdbc:h2:<relative path to db>;LOG=0;UNDO_LOG=0.

As already mentioned, the error cannot be reproduced reliably, it only occurs on one machine (to which I have no direct access) in at most half of the runs.

The resulting database cannot be opened with error "java.lang.IllegalStateException: Unable to read the page at position 194338680221459 [1.4.200/6]" (as it is probably corrupted).

Do you have any idea what could cause this error, or how I could help you to fix it (or how I could avoid it)?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions