Is it possible in Kyoto Cabinet database to make safely a database snapshot and concurrently write to database in the same time ?
The KyotoCabinet database class kyotocabinet.DB (for JAVA among other languages) provides the following methods:
boolean dump_snapshot(String dest) // Dump records into a snapshot file.
boolean copy(String dest) // Create a copy of the database file.
Both operations could be quite long. I did not test this methods directly but by using the kcpolymgr utility from different process. I found that the operations blocks other writer process-es (kcpolymgr set) until the operations finish.
Is the behaviour the same when writes come from other threads in the same process ?
The snapshot or copy of the database blocks concurrent database operations from other threads and processes.
To test within the same process I exposed the Kyoto Cabinet methods by JMX and tried to
setorgetany value from the database while concurrently a snapshot or a copy were being in progress.Methods
setandgetwere waiting for the concurrent snapshot or copy to finish.I found a part of the documentation that covers the issue. It mansions the cache hash database but it looks like the other database implementations behaves similarly: