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

TxnDB : Transactions via rocksdb_transaction_t #144

Open
rrichardson opened this issue Oct 19, 2017 · 7 comments
Open

TxnDB : Transactions via rocksdb_transaction_t #144

rrichardson opened this issue Oct 19, 2017 · 7 comments
Assignees

Comments

@rrichardson
Copy link
Contributor

Transaction functionality is exposed in rocksdb via a parallel implementation of the rocksdb_t called rocksdb_transaction_t . Now that we have bindgen (#143) we get access to it for "free".

First, for brevity, I propose a new acronym that is the RocksDB parallel of CRUD, I call it
PIGMED , that's Put Iterate MErge Delete. Not catchy, I know.

The question is how to best expose the Transaction functionality while :

  1. Not duplicating the entire DB impl for TxnDB
  2. Maintaining type safety.

There are quite a few new methods for TxnDb that would need to be wrapped, some of them might make sense as guards or even closures.

I don't think there is a way to unify the PIGMED operations of DB and TxnDB while retaining type safety or even ergonomics. But there isn't actually a ton of PIGMED functionality in DB.

I propose we move all of the utility/environment functionality, that is anything that doesn't require a rocksdb_t into a separate utility module or modules (e.g. rocksdb::cf::create for rocksdb_create_cf)

We then slim down DB to just the PIGMED operations.

My hope is that we would be able to leverage the same Iterator functionality. There is a rocksdb_transaction_create_iterator but the iterator_t is the same.

Thoughts?

@prasannavl
Copy link

Looks like this has been there for a while. Just thought I'll drop a quick to see if there's any update on this? I'm holding off using rocksdb for some rust services due to transactions.

@iSynaptic
Copy link
Member

Is this satisfied by #250?

@prasannavl
Copy link

I think so. Looking forward to it getting merged :)

@iSynaptic
Copy link
Member

I reread @rrichardson earlier comments and I think this issue is referring to the "pessimistic" version of transactional RocksDB, whereas #250 is adding the "optimistic" version. I think we should be able to land both, leveraging much of the work in #250.

I'm currently working on some internal restructuring in #268 that will make it easier to implement both TransactionalDB and OptimisticTransactionalDB without a lot of code duplication.

@iSynaptic
Copy link
Member

There are some missing methods in C API to make TransactionalDB roughly equivalent DB (see facebook/rocksdb#4999). That needs to be resolved before we can land this feature.

@iSynaptic
Copy link
Member

@hnakamur submitted facebook/rocksdb#5077 to add the missing APIs. Once they become available in a release, I'll work on adding support for it here in the Rust binding.

@TheWaWaR
Copy link

@iSynaptic
facebook/rocksdb#5077 already merged, and I saw the update appeared in the latest release version.

Can you please revisit current PR?

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

No branches or pull requests

4 participants