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

add transaction support #250

Closed
wants to merge 46 commits into from
Closed

add transaction support #250

wants to merge 46 commits into from

Conversation

hjiayz
Copy link

@hjiayz hjiayz commented Feb 1, 2019

No description provided.

src/lib.rs Outdated Show resolved Hide resolved
@iSynaptic
Copy link
Member

@hjiayz Thanks for putting this together. I took a quick pass over it, but it's a big PR, so I'm going to set aside some time to do a proper review.

@iSynaptic
Copy link
Member

@hjiayz I haven't forgotten about doing a review. Been closing out a few other PRs I was directly involved in. Also, CI builds now have rustfmt checks. After you make your changes, you may need to run cargo fmt --all before this can be merged to master.

src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
tests/test_optimistic_transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
add test doc
fix bug
fix snapshot mode
src/db.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
Copy link
Member

@iSynaptic iSynaptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @hjiayz! I finally got some time to do a review. One other thing I would suggest: either consider how implementing TransactionDB would impact your design, or if you are so inclined, go ahead and implement TransactionDB as part of this PR.

src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/optimistic_transaction_db.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
src/transaction.rs Outdated Show resolved Hide resolved
@iSynaptic
Copy link
Member

@aleksuss As requested, I submitted my review. Thanks for the reminder!

impl CreateCf for TransactionDB
@hjiayz hjiayz changed the title add optimistic transaction support add transaction support May 15, 2019
fix readoptions
/// Wrapper around RocksDB PinnableSlice struct.
///
/// With a pinnable slice, we can directly leverage in-memory data within
/// RocksDB toa void unnecessary memory copies. The struct here wraps the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: to avoid

@TheWaWaR
Copy link

Any update?

}
}

pub fn put_cf<K, V>(&mut self, cf: ColumnFamily, key: K, value: V) -> Result<(), Error>
Copy link
Contributor

@zhangsoledad zhangsoledad Jun 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface around ColumnFamily should be consistency.
should be cf: &ColumnFamily here.

}
}

pub fn merge_cf<K, V>(&mut self, cf: ColumnFamily, key: K, value: V) -> Result<(), Error>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be cf: &ColumnFamily

}
}

pub fn delete_cf<K: AsRef<[u8]>>(&mut self, cf: ColumnFamily, key: K) -> Result<(), Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be cf: &ColumnFamily

/// keys exist in the range ["begin_key", "end_key").
pub fn delete_range_cf<K: AsRef<[u8]>>(
&mut self,
cf: ColumnFamily,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be cf: &ColumnFamily

@anelson
Copy link

anelson commented Jul 18, 2019

@hjiayz thanks for putting the effort into this PR. I'm sure I'm not the only one eagerly awaiting this merge. I'm dying to use RocksDB as part of a Rust project but the lack of transactions has been a deal breaker up to this point.

Is there any way I can help to move this forward? It looks like it's almost there with just some minor requests outstanding...

// needed to disambiguate directories when running in
// a multi-threaded environment (eg. `cargo test`) since
// there is no guarantee time will be unique
let path_num = PATH_NUM.fetch_add(1, Ordering::SeqCst);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really think it is a necessary variable for creation unique path? Maybe a time would be enough ?

}
}

impl Open for TransactionDB {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason OpenCF is not implemented for TransactionDB?

}
}

pub trait CreateCf {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateCf, and DropCf, but OpenCF. Consistent capitalization?

@liquidscorpio
Copy link

Any updates on this PR?

@sergeyzenchenko
Copy link

hey guys, do you need any help on it? It's kind of important to have

@vitvakatu
Copy link

Well, whoever can help with updating and finishing this PR is welcome. The diff is absolutely ridiculous in size, so we'll need reviewers as well.

@aleksuss
Copy link
Member

I think it makes sense to create a new PR for this. This PR seems very huge and includes adding not only transactions support.

@acrrd acrrd mentioned this pull request May 24, 2020
rleungx pushed a commit to rleungx/rust-rocksdb that referenced this pull request Jun 17, 2020
Previous implementation relies on auto compactions to move files to
the specific level, which is not reliable. This PR controls the
compaction manually to make sure the files will be placed at the
expected level.
@YjyJeff
Copy link

YjyJeff commented Jun 15, 2021

Any updates about this PR?

@aleksuss
Copy link
Member

Closed in favour #565

@aleksuss aleksuss closed this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.