-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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 Transactions and Checkpoint to C API #2236
Conversation
@siying has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Thank you for contributing. Can you follow the formatting convention in this code base (like 2-char indenting)? |
@boolean5 updated the pull request - view changes - changes since last import |
Done. I believe it is ok now. Please, let me know if there is anything else I can do to help merge this pull request. |
This looks great! I was just looking for checkpoint support in the C API. Anything holding op the merge? |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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.
See comment regarding deleting the transaction.
Also please run make format
once to fix formatting.
CheckTxnDBGet(txn_db, roptions, "foo", NULL); | ||
|
||
// begin a transaction | ||
txn = rocksdb_transaction_begin(txn_db, woptions, txn_options, NULL); |
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.
ASAN complains about txn
is not deleted. How about adding a rocksdb_transaction_destroy()
method?
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.
Ok, I added the method.
Let me know if I should fix anything else.
@boolean5 updated the pull request - view changes - changes since last import |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@boolean5 Unfortunately there's merge conflict now. Do you mind rebase? Thanks! |
remove DestroyDb for TransactionDB add Options for Transaction and TransactionDB add transactions to C API - batch 2 add Checkpoint last fixes
9954c4a
to
d5d7056
Compare
@boolean5 updated the pull request - view changes - changes since last import |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
CheckTxnDBGet(txn_db, roptions, "foo", "hello"); | ||
|
||
// reuse old transaction | ||
txn = rocksdb_transaction_begin(txn_db, woptions, txn_options, txn); |
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.
you need to destroy the old txn before creating a new one.
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 thought the whole point of the last parameter of rocksdb_transaction_begin was to avoid deallocating and reallocating a transaction, as stated here: https://github.com/facebook/rocksdb/blob/master/include/rocksdb/utilities/transaction_db.h#L158
Isn't it so?
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.
@boolean5 sorry, I misread it. But ASAN is still complaining about the txn not getting destroy. Mind debug it? You can run COMPILE_WITH_ASAN=1 make c_test && ./c_test
to reproduce.
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.
Found it. The bug was in c.cc, in rocksdb_transaction_begin(), where I was allocating a new transaction even when an old one was passed as an argument. Thanks for pointing this out.
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.
Awesome!
@boolean5 updated the pull request - view changes - changes since last import |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@boolean5 updated the pull request - view changes - changes since last import |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Looks like this broke the appveyor build https://ci.appveyor.com/project/Facebook/rocksdb/build/1.0.4437 |
Seems that the appveyor build has been broken with the same compilation messages at least since commit f720796 : https://ci.appveyor.com/project/Facebook/rocksdb/build/1.0.4421 |
Ah, you're right. Also, it looks like AppVeyor isn't currently building
`master` at all? That doesn't seem right. cc @yiwu-arbug
…On Wed, May 17, 2017 at 12:12 PM, boolean5 ***@***.***> wrote:
Seems that the appveyor build has been broken with the same compilation
messages at least since commit f720796
<f720796>
: https://ci.appveyor.com/project/Facebook/rocksdb/build/1.0.4421
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2236 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABdsPFDnzXoKbUdulxIRpzp8jPokA762ks5r6xxkgaJpZM4NNdNo>
.
|
Thanks @sagar0! This PR has been merged, so nothing needs to be done. |
Oh, my bad. Didn't notice that this PR has already been merged. |
I've added functions to the C API to support Transactions as requested in #1637 and to support Checkpoint.
I have also added the corresponding tests to c_test.c
For now, the following is omitted: