Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open the same db in read only mode #811

Open
0x8f701 opened this issue May 22, 2024 · 5 comments
Open

open the same db in read only mode #811

0x8f701 opened this issue May 22, 2024 · 5 comments

Comments

@0x8f701
Copy link

0x8f701 commented May 22, 2024

Error: Database already open. Cannot acquire lock.

I have one process which does read & write, another process which does read

@0x8f701
Copy link
Author

0x8f701 commented May 22, 2024

rocksdb allows to open in readonly mode

@0x8f701 0x8f701 changed the title open the same db in different process open the same db in read only mode May 23, 2024
@lhallam
Copy link

lhallam commented May 23, 2024

See #678

@0x8f701
Copy link
Author

0x8f701 commented May 29, 2024

rocksdb read only mode cannot sync with the write, secondary db instance doesn't work well either, if we cannot find a very useful and elegant solution, then I think we can abandon this

the whole point is to have 1 R/W + n R instances and the n read instances can sync well with the write

@axww
Copy link

axww commented Nov 21, 2024

I believe this is available now since the document clarifies:
https://docs.rs/redb/latest/redb/struct.Database.html
Opened redb database file:
Multiple reads may be performed concurrently, with each other, and with writes.
pub fn begin_read(&self):
Read transactions may exist concurrently with writes

@dpc
Copy link

dpc commented Dec 26, 2024

@axww AFAICT what you're quoting applies only within one process. What the OP asked for is multiple processes opening the same database. AFAIU as per #678 this should be possible in the future, but is currently not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants