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

Random crashes with exception "Fatal Exception: java.lang.IllegalStateException: Chunk 55267 not found" #386

Closed
lahiruchandima opened this issue Nov 30, 2020 · 8 comments · Fixed by otto-de/synapse#81
Assignees
Labels
Milestone

Comments

@lahiruchandima
Copy link

I randomly get below exceptions reported in my android app which uses nitrite 3.3.0.

   Fatal Exception: java.lang.IllegalStateException: Chunk 55267 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.CursorPos.traverseDown(CursorPos.java:58)
   at org.h2.mvstore.MVMap.operate(MVMap.java:1804)
   at org.h2.mvstore.MVMap.putIfAbsent(MVMap.java:564)
   at org.dizitart.no2.store.NitriteMVMap.putIfAbsent(NitriteMVMap.java:105)
   at org.dizitart.no2.internals.DataService.insert(DataService.java:84)
   at org.dizitart.no2.internals.DataService.update(DataService.java:135)
   at org.dizitart.no2.internals.NitriteService.update(NitriteService.java:373)
   at org.dizitart.no2.internals.DefaultNitriteCollection.update(DefaultNitriteCollection.java:322)
   at org.dizitart.no2.objects.DefaultObjectRepository.update(DefaultObjectRepository.java:141)
   at org.dizitart.no2.objects.DefaultObjectRepository.update(DefaultObjectRepository.java:126)
   at com.my.app.DatabaseHelper.persistReceipt(DatabaseHelper.java:619)
   ...
   ...
   Caused by java.lang.IllegalStateException: Chunk 55194 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 java.util.LinkedHashSet.<init>(LinkedHashSet.java:81)
   at org.dizitart.no2.filters.NotFilter.matchedSet(NotFilter.java:41)
   at org.dizitart.no2.filters.NotFilter.apply(NotFilter.java:52)
   at org.dizitart.no2.objects.filters.NotObjectFilter.apply(NotObjectFilter.java:51)
   at org.dizitart.no2.internals.SearchService.find(SearchService.java:67)
   at org.dizitart.no2.internals.DataService.remove(DataService.java:211)
   at org.dizitart.no2.internals.NitriteService.remove(NitriteService.java:384)
   at org.dizitart.no2.internals.DefaultNitriteCollection.remove(DefaultNitriteCollection.java:360)
   at org.dizitart.no2.objects.DefaultObjectRepository.remove(DefaultObjectRepository.java:176)
   at org.dizitart.no2.objects.DefaultObjectRepository.remove(DefaultObjectRepository.java:170)
   at com.my.app.DatabaseHelper.removeReceipts(DatabaseHelper.java:666)
   ...
   ...

I reported this issue in h2-database in following issue. The response from them was this could be due to not using registerVersionUsage() and deregisterVersionUsage(). I couldn't find these methods when I searched nitrite code, so this is a possibility.

h2database/h2database#2590 (comment)

If using registerVersionUsage() and deregisterVersionUsage() could affect performance, let the uses of nitrite configure whether it could be used or not.

@anidotnet
Copy link
Contributor

I'll take a look

@anidotnet anidotnet self-assigned this Nov 30, 2020
@anidotnet anidotnet added the bug label Nov 30, 2020
@anidotnet anidotnet added this to the 3.4.3 milestone Nov 30, 2020
anidotnet added a commit that referenced this issue Nov 30, 2020
@anidotnet
Copy link
Contributor

Code changes should be available in 3.4.3-SNAPSHOT. Please verify if that solves the issue or not.

@lahiruchandima
Copy link
Author

@anidotnet Unfortunately it is not easily re-producible this. Actually I tried to re-produce it by doing concurrent reads, writes and updates in high rates, but couldn't recreate it locally.

I get these crash reports randomly from android crash reporting of my app.

Thanks for fixing this anyway. If you can provide 3.4.3 release, I can upgrade to it. It is too risky for me to link the prod version to a snapshot.

@lahiruchandima
Copy link
Author

@anidotnet Can you please let us know roughly when we would be able to expect 3.4.3 to be released?

@anidotnet
Copy link
Contributor

As soon as possible.

@lahiruchandima
Copy link
Author

As soon as possible.

Thank you

@anidotnet
Copy link
Contributor

Version 3.4.3 is released now.

@lahiruchandima
Copy link
Author

Great! Thank you.

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

Successfully merging a pull request may close this issue.

2 participants