Error during compact execution

106 views
Skip to first unread message

tleg...@infovista.com

unread,
Sep 24, 2013, 3:31:27 AM9/24/13
to ma...@googlegroups.com
Hello,

I'm using the latest version of mapdb and sometimes I have the following exception (under windows):
INFO   | jvm 1    | 2013/09/24 07:32:57 | Caused by: java.lang.InternalError: could not rename file
INFO   | jvm 1    | 2013/09/24 07:32:57 | at org.mapdb.StoreDirect.compact(StoreDirect.java:670)
INFO   | jvm 1    | 2013/09/24 07:32:57 | at org.mapdb.StoreWAL.compact(StoreWAL.java:743)
INFO   | jvm 1    | 2013/09/24 07:32:57 | at org.mapdb.EngineWrapper.compact(EngineWrapper.java:111)
INFO   | jvm 1    | 2013/09/24 07:32:57 | at org.mapdb.EngineWrapper.compact(EngineWrapper.java:111)
INFO   | jvm 1    | 2013/09/24 07:32:57 | at org.mapdb.DB.compact(DB.java:1264)

After this exception, mapdb is unusable and I lost all datas:
INFO   | jvm 1    | 2013/09/24 07:34:17 | Caused by: java.lang.NullPointerException
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.Volume$ByteBufferVol.internalByteBuffer(Volume.java:317)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.Volume$ByteBufferVol.getLong(Volume.java:356)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.StoreWAL.getLongStackPage(StoreWAL.java:575)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.StoreWAL.longStackTake(StoreWAL.java:599)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.StoreDirect.freePhysTake(StoreDirect.java:833)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.StoreDirect.physAllocate(StoreDirect.java:509)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.StoreWAL.put(StoreWAL.java:98)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.Caches$HashTable.put(Caches.java:186)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.EngineWrapper.put(EngineWrapper.java:45)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.SnapshotEngine.put(SnapshotEngine.java:44)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.BTreeMap.put2(BTreeMap.java:712)
INFO   | jvm 1    | 2013/09/24 07:34:17 | at org.mapdb.BTreeMap.put(BTreeMap.java:566) 

Questions are :
How to prevent from this issue?
How to restore original files?
How to perform a backup before the compact execution?

Note: Exception  in the code is here 
            if(!physFile.renameTo(physFile_))throw new InternalError("could not rename file");
Maybe it can be useful to add more information in InternalError like throw new InternalError("could not rename file " + physFile + " to" + physFile_)

Thanks.

Jan Kotek

unread,
Sep 25, 2013, 9:32:42 AM9/25/13
to ma...@googlegroups.com, tleg...@infovista.com
Hi,

Windows file locking is broken. For memory mapped files it does not
release locks until system is restarted.

Solution is to disable use RandomAccessFiles (slower) or migrate to
linux.

I hope I will come with something better.

Jan
signature.asc

Rajiv Kumar

unread,
Sep 1, 2014, 1:54:44 AM9/1/14
to ma...@googlegroups.com, tleg...@infovista.com, j...@kotek.net
Hi Jan,

I am still facing this issue with mapdb 1.0.4/1.0.6. 

An exception occurred: java.lang.AssertionError: could not rename file
 at org.mapdb.StoreDirect.compact(StoreDirect.java:857)
 at org.mapdb.EngineWrapper.compact(EngineWrapper.java:130)
 at org.mapdb.DB.compact(DB.java:1607)
 at ...

Any idea on the timeline for resolution?

Regards
Rajiv
Reply all
Reply to author
Forward
0 new messages