Intermittent problem when opening database #263
-
I'm running version 1.4.0, however this problem was also present in previous versions. Now and then, I get following error: Error occurred in storage channel#0
org.eclipse.store.storage.exceptions.StorageExceptionIoWriting: null
at org.eclipse.store.storage.types.StorageFileWriter.truncateFile(StorageFileWriter.java:168)
at org.eclipse.store.storage.types.StorageFileWriter.truncate(StorageFileWriter.java:144)
at org.eclipse.store.storage.types.StorageFileManager$Default.handleLastFile(StorageFileManager.java:1304)
at org.eclipse.store.storage.types.StorageFileManager$Default.initializeForExistingFiles(StorageFileManager.java:1011)
at org.eclipse.store.storage.types.StorageFileManager$Default.initializeStorage(StorageFileManager.java:886)
at org.eclipse.store.storage.types.StorageChannel$Default.initializeStorage(StorageChannel.java:782)
at org.eclipse.store.storage.types.StorageChannelTaskInitialize$Default.succeed(StorageChannelTaskInitialize.java:200)
at org.eclipse.store.storage.types.StorageChannelTaskInitialize$Default.succeed(StorageChannelTaskInitialize.java:34)
at org.eclipse.store.storage.types.StorageChannelSynchronizingTask$AbstractCompletingTask.synchronizedComplete(StorageChannelSynchronizingTask.java:78)
at org.eclipse.store.storage.types.StorageChannelSynchronizingTask$AbstractCompletingTask.complete(StorageChannelSynchronizingTask.java:126)
at org.eclipse.store.storage.types.StorageChannelTask$Abstract.processBy(StorageChannelTask.java:260)
at org.eclipse.store.storage.types.StorageChannel$Default.work(StorageChannel.java:453)
at org.eclipse.store.storage.types.StorageChannel$Default.run(StorageChannel.java:536)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.eclipse.store.storage.exceptions.StorageExceptionConsistency: Reopened file has inconsistent size: Expected size 50962 != actual size 51066.
at org.eclipse.store.storage.types.StorageLiveDataFile$Default.internalOpenWriting(StorageLiveDataFile.java:282)
at org.eclipse.store.storage.types.StorageFile$Abstract.ensureWritable(StorageFile.java:390)
at org.eclipse.store.storage.types.StorageFile$Abstract.truncate(StorageFile.java:366)
at org.eclipse.store.storage.types.StorageFileWriter.truncateFile(StorageFileWriter.java:164) Where is this coming from ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
To investigate the issue, we need some more information:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the additional info and code. Looks like a bug. |
Beta Was this translation helpful? Give feedback.
-
The problem is caused by an incomplete store that can’t be reverted if the SqlConnector is used. To avoid such incomplete stores, you should always shutdown the storage using the shutdown() method before terminating your app. Maybe you can try to repair the storage by truncating the storage data manually. |
Beta Was this translation helpful? Give feedback.
The problem is caused by an incomplete store that can’t be reverted if the SqlConnector is used.
This must be fixed in the EclipseStore code.
To avoid such incomplete stores, you should always shutdown the storage using the shutdown() method before terminating your app.
Maybe you can try to repair the storage by truncating the storage data manually.
To do so you need to look for a table named "microstream_storage$channel_0" in the db.
This table should have entries with identifiers like “channel_0_n.dat”. Look for the identifier that has the greatest number “n” and delete all entries that have a “start” value greater or equals 50962 (the last known valid size).