Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H2 shows StackOverflowError when flush data to file. #3732

Open
tdwu opened this issue Feb 14, 2023 · 5 comments
Open

H2 shows StackOverflowError when flush data to file. #3732

tdwu opened this issue Feb 14, 2023 · 5 comments

Comments

@tdwu
Copy link

tdwu commented Feb 14, 2023

In the cluster mode of H2 version 2.1.212, H2 shows StackOverflowError when flush data to file.
Looks like recursion is going on but not ending normally.

2023-02-07 05:02:51.857 [H2-serialization] [ERROR] h2database - biz_HA:database flush
org.h2.message.DbException: General error: "org.h2.mvstore.MVStoreException: java.lang.StackOverflowError [2.1.212/3]" [50000-212]
at org.h2.message.DbException.get(DbException.java:212)
at org.h2.message.DbException.convert(DbException.java:395)
at org.h2.mvstore.db.Store.lambda$new$0(Store.java:124)
at org.h2.mvstore.MVStore.handleException(MVStore.java:3349)
at org.h2.mvstore.MVStore.panic(MVStore.java:590)
at org.h2.mvstore.MVStore.serializeAndStore(MVStore.java:1617)
at org.h2.mvstore.MVStore.lambda$storeNow$4(MVStore.java:1530)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "org.h2.mvstore.MVStoreException: java.lang.StackOverflowError [2.1.212/3]" [50000-212]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:554)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
... 12 common frames omitted
Caused by: org.h2.mvstore.MVStoreException: java.lang.StackOverflowError [2.1.212/3]
at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:1004)
... 7 common frames omitted
Caused by: java.lang.StackOverflowError: null
at org.h2.mvstore.type.BasicDataType.write(BasicDataType.java:67)
at org.h2.mvstore.Page.write(Page.java:720)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1329)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)
at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1344)
at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1330)

@tdwu
Copy link
Author

tdwu commented Feb 15, 2023

I don't know about the data structure relationship, is the tree node too deep? Or is there a child node that contains data from a parent among its children?

图片

@grandinj
Copy link
Contributor

The DB is most likely corrupted, if you have stack-overflow there. I would suggest updating to a newer version, or even building from the repo.

@tdwu
Copy link
Author

tdwu commented Feb 15, 2023

Hi @grandinj

thanks for your reply.

Currently, the StackOverflowError happens several times a day in my lab. But it can work fine on another server with the same version, configuration, and table structure.

So I want to know the root cause. And how to avoid a repeat of it。

PS: All SQL and operations are normal, nothing special。

@grandinj
Copy link
Contributor

It is probably a bug in H2, and we have fixed some similar bugs in the last couple of releases, so upgrading might solve it.

If upgrading does not solve it, then it is a new bug.

@tdwu
Copy link
Author

tdwu commented Feb 15, 2023

Could you mind to provide the similar bugs Id or links that have been fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants