I have a rockDB write instance which writes data to "/rocksDB/data" . I have read instances which are also pointing to "/rocksDB/data" but they are unable to read data which is being written by write instance. If i restart the read instances , they are then able to read the data. Is there a way for read instances to read the latest keys written by write instances without having to restart .
Also would be interested to understand the reason behind this behavior . Any flag which can be added to let read instances fetch data without having to restart?
Read and Write should be handled in the same process, you can use multiple threads to do read and write, which guarantees read-your-write. There's no such guarantee when you read from a different process. The RocksDB Secondary instance feature is designed to open the same DB in read-only mode from different process, it won't refresh when the DB is changed, there's an API
db->TryCatchUpWithPrimary()
to update with primary DB.