Issue
I am using RocksDB and i love the performance of it. I am using it in my high requests/second server for the GET operation.
The problem is that i need to update my RocksDB from time to time.
So, i have Process_A that keeps rocksdb opened and keeps on performing get operations on it.
Now, i want Process_B to run in a crontab every X amount of time (let's say 30 minutes) that will come and add a couple of entries in the RocksDB.
The problem is that the file is in use, and i get the LOCK error, naturally. I am running this on debian buster. What puzzles me though, is that it kind of works randomly.
Did anybody try this scenario? Or maybe knows a better way of doing this?
The other way would be to stop Process_A, perform the updates with Process_B, then restart Process_A, but this would cause me to lose requests...
Thank you.
Solution
You cannot open the same DB with 2 processes, if both have write permission.
If you have one process for write, another one for read, the data will not be synced until it's flushed. For concurrently read/write, typically the user creates multiple threads in one process.
Answered By - Jay Zhuang Answer Checked By - Mary Flores (WPSolving Volunteer)