feat(storage): add rocksdb provider into database provider#20253
feat(storage): add rocksdb provider into database provider#20253fgimenez merged 4 commits intoparadigmxyz:mainfrom
Conversation
615f6f6 to
cb7f785
Compare
There was a problem hiding this comment.
this is no-op version of rocksdb provider which help simplify integrate into DatabaseProvider
3039b51 to
08722e9
Compare
fgimenez
left a comment
There was a problem hiding this comment.
looks good, some initial suggestions
404ade4 to
fbcd569
Compare
|
thank sir @fgimenez, I’ve pushed the fixes for the comments — it’s ready for review |
Add RocksDB variants to EitherReader, EitherWriter, and EitherWriterDestination enums. **Changes** - Add `EitherWriterDestination::RocksDB` variant - Add `EitherWriter::RocksDB` variant (cfg-gated) - Add `EitherReader::RocksDB` variant (cfg-gated) **Note**: Constructors for RocksDB tables will be added in a follow-up PR after #20253 (RocksDBProviderFactory) merges. Closes #20278, #20279, #20280
fgimenez
left a comment
There was a problem hiding this comment.
lgtm, pending @Rjected @joshieDo @shekhirin @yongkangc
fbcd569 to
0ce6a2a
Compare
0ce6a2a to
873bb06
Compare
|
I rebase this and fix as #20288 (review) suggest, it ready to review |
873bb06 to
609e884
Compare
| ), | ||
| }; | ||
| // TransactionDB only support read-write mode | ||
| let rocksdb_provider = RocksDBProvider::builder(data_dir.rocksdb()) |
There was a problem hiding this comment.
context: there is AccessRights::RW and AccessRights::RO, in case of rocksdb, there is only support read write mode, so, in AccessRights::RO, behind rocksdb will use read write mode
I'm not sure if this is what we want sir @fgimenez, as #20288 (review) suggest should remove readonly mode, so this code here adapt to it
There was a problem hiding this comment.
yes, this approach is correct, TransactionDB does not support RO and we always create RocksDB in RW no matter the value of AccessRights. AccessRights enum controls MDBX and StaticFiles access, not RocksDB.
One remaining thing, we can now remove the unused ReadOnlyRocsDBAccess error variant from crates/storage/errors/src/provider.rs, not used anywhere
There was a problem hiding this comment.
thanks, I fixed that 💯
609e884 to
7b6f716
Compare
Resolve #20152
Changes:
rocksdb_stub.rs(stub for non-Unix, no feature),rocksdb_provider.rs(for unix, enabled rocksdb feature)RocksDBProvidertoProviderFactorywith builder pattern/rocksdbdirectory alongside/dband/static_files