-
Notifications
You must be signed in to change notification settings - Fork 107
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
change(state): Allow opening the database in a read-only mode #8079
Conversation
We can open another ticket to clean that up. It's not really a problem because trying to write will fail. (And either panic or return an error, depending on how we handle RocksDB write errors.) One possible solution is having a type that implements all the read methods, but only implements the two write methods: For example, the second generic parameter here is required to be DBWithThreadModeInner, we could do something similar with a ReadWriteDatabase unit struct: And here are the methods that work regardless of the generic type (for us that would be read methods):
I don't think the difference is that important, but a random temporary directory would avoid locking conflicts with multiple secondaries: When using ldb I've just been giving an empty string, which I assume uses the current directory, or a temporary directory, or no directory. It hasn't caused any errors or created any files yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is some great work!
I'm not sure if it's out of scope for the MVP, happy to let the team make a call on that.
Co-authored-by: teor <teor@riseup.net>
I'm putting this PR out of the draft since it looks like we can merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've scheduled this after the scanner tests merge, because they are blocking other work.
6edb581
to
0add33c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a bit of a merge and cleanup, let's see how it goes
There was still an issue with path resolution that should be fixed now. I also updated the description and labels. All should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I've made this merge wait until after #8080, because that's blocking some final tests.
How did you do that? |
Using They also have a |
@Mergifyio refresh |
✅ Pull request refreshed |
This only failed the merge queue due to #7898 |
Motivation
Close #8078.
Depends-On: #8080
PR Author Checklist
Check before marking the PR as ready for review:
Specifications
RocksDB's "read-only" and "secondary" modes: https://github.com/facebook/rocksdb/wiki/Read-only-and-Secondary-instances
Rust bindings:
Solution
Notes
secondary_path
in open_cf_descriptors_as_secondary should be.Testing
zebra-scan
crate in a separate binary while Zebra was running.Review
Reviewer Checklist
Check before approving the PR:
PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.