-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: ADR-040: Implement RocksDB backend #9851
Conversation
Depends on #9573, so this will be a draft until that is merged. |
7c37ce1
to
77f5053
Compare
e5985c5
to
3b1df92
Compare
Rebased and ready for review |
82cfe31
to
35ade40
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.
Nice work :)
db/go.mod
Outdated
) | ||
|
||
replace github.com/tecbot/gorocksdb => github.com/roysc/gorocksdb v1.1.0 // v0.0.0-20210804143633-c0bf0b3635e5 // FIXME |
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.
would be good to add more context to the FIXME for the next person
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.
Sorry, I had hoped there might be movement on their upstream repo before this was to be merged. That seems unlikely now.
Would it be better to have this point to a cosmos/gorocksdb
fork before merging?
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.
if you dont want to maintain it, this would be the best solution. @alexanderbez what you think?
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 mean I honestly don't see us maintaining it -- they would diverge quickly I imagine. I'm actually concerned that it's not merged into the main upstream repo. Is there a reason for that?
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.
It seems to just be neglected, there's been no activity for almost two years. The PR adds some some simple bindings. I don't really mind using my fork, just not sure what the preference is on your end.
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.
TBH, if a db backend has been neglected for that long, I'm very very apprehensive about supporting it. We can totally not support RocksDB.
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.
Just to be clear, this is an unofficial Go wrapper I'm talking about. The Rocks maintainers were pretty efficient about merging my PR to add the needed C bindings.
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 think its fine, our default db currently, leveldb, is not maintained as well. I would prefer we create a fork in cosmos and add a downstream pr opening bot if anything changes upstream.
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.
The Rocks maintainers were pretty efficient about merging my PR to add the needed C bindings.
Then we should go with this. I do not feel comfortable maintaining support for physical backends that are not actively maintained, even if they're just wrappers.
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.
RocksDB doesn't provide Go bindings. The tecbot repo is the main third-party solution: https://github.com/facebook/rocksdb/blob/main/LANGUAGE-BINDINGS.md.
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.
part 1 of the review
) | ||
// FIXME: gorocksdb bindings for OptimisticTransactionDB are not merged upstream, so we use a fork | ||
// See https://github.com/tecbot/gorocksdb/pull/216 | ||
replace github.com/tecbot/gorocksdb => github.com/roysc/gorocksdb v1.1.0 |
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.
let's fork it into cosmos/gorocsdb
. We did the same with keyring
. @okwme , could you fork github.com/tecbot/gorocksdb
in to cosmos?
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.
Will be solved here: #10263
Updated per reviews and merged master |
fefdcb4
to
5911cfe
Compare
@roysc - could you merge |
* use optimistic transactions * checkpoint-based versioning
multiple past readers squash! db txn testcases
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
64d657f
to
9cbf319
Compare
Codecov Report
@@ Coverage Diff @@
## master #9851 +/- ##
==========================================
- Coverage 64.15% 63.73% -0.42%
==========================================
Files 572 572
Lines 53983 53966 -17
==========================================
- Hits 34632 34397 -235
- Misses 17375 17612 +237
+ Partials 1976 1957 -19
|
This has been updated with a
|
Description
Partially resolves: vulcanize#14
Implements a RocksDB-based backend for the DB interface introduced by #9573 and specified by ADR-040.
OptimisticTransactionDB
to allow concurrent transactions with write conflict detection. This depends on some additional CGo bindings - see Add go.mod file, update for 6.16 tecbot/gorocksdb#216, Add more C bindings for OptimisticTransactionDB facebook/rocksdb#8526. We'll need to replace thegorocksdb
module until these are upstream.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change