-
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
Fix BlobDB::Get which only get out the value offset #2553
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
@foolenough Thank you for the fix! Do you mind signing the CLA? |
@yiwu-arbug I've signed the CLA now. Thanks for your review. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@foolenough Thanks. Actually I don't quite understand the fix. It seems that we forget to update BlobDB::Get with PinnableSlice, but how does it cause blob db return offset rather than value? And it doesn't seems to be caught by blob_db_test. |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@yiwu-arbug There are three version of Get method in db.h
The StackableDB override the designated getter of DB correctly.
But the BlobDB::Get override the wrong version of getter.
Thus the Get(const ReadOptions& options, ColumnFamilyHandle* column_family, const Slice& key, PinnableSlice* value) is not overrided, and it would call the StackableDB::Get, which just return the value offset but not the actual value. The blob_db_test calls blobdb->Get(const ReadOptions& options, ColumnFamilyHandle* column_family, const Slice& key, std::string* value), which is correctly override. But this method is not the designated getter, the getter methods is not consistent with each other. When run benchmark with db_bench readrandom -use_blob_db, which use PinnableSlice version getter, the result is wrongly too high, as it doesn't fetch the value in blob file. |
34d0157
to
608ee17
Compare
@foolenough updated the pull request - view changes - changes since last import |
I see. Do you mind adding a test to blob_db_test, which wrap BlobDB with a StackableDB and verify return value of StackableDB::Get is correct? |
BTW are you trying to use blob db? The feature is not ready yet. There are bug fixing ongoing. |
608ee17
to
374f3af
Compare
@foolenough updated the pull request - view changes - changes since last import |
The verifyDB method in BlobDBTest uses only one version of BlobDB::Get. Add test case in blob_db_test to test all Get methods.
Blob db use StackableDB::get which only get out the value offset, but not the value. Fix by making BlobDB::Get override the designated getter.
374f3af
to
14ad364
Compare
@foolenough updated the pull request - view changes - changes since last import |
@yiwu-arbug I've added the test case which would fail without the fix patch. I am currently benchmarking the blob db, and want to add a config option like Use_BlobDB_Value_Size. When the value size is large than the configure value, the value What's your mean about NOT ready? How long would it take to use blob db in production? |
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@foolenough Appreciate the fix. There a crashes we see in our shadow test need to fix, and I'm still investigating it. No ETA for production yet. Where do you plan to use blob db? To me, option to store value in LSM is something blob db should have. How do you plan to implement it? We have a placeholder here which is unimplemented :/ |
Summary: Blob db use StackableDB::get which only get out the value offset, but not the value. Fix by making BlobDB::Get override the designated getter. Closes #2553 Differential Revision: D5396823 Pulled By: yiwu-arbug fbshipit-source-id: 5a7d1cf77ee44490f836a6537225955382296878
Blob db use StackableDB::get which only get out the
value offset, but not the value.
Fix by making BlobDB::Get override the designated getter.