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

multiget support for timestamps #6483

Closed
wants to merge 3 commits into from

Conversation

hliu18
Copy link
Contributor

@hliu18 hliu18 commented Mar 4, 2020

Add timestamp support for MultiGet().
timestamp from readoptions is honored, and timestamps can be returned along with values.

MultiReadRandom perf test (10 minutes) on the same development machine ram drive with the same DB data shows no regression (within marge of error). The test is adapted from https://github.com/facebook/rocksdb/wiki/RocksDB-In-Memory-Workload-Performance-Benchmarks.
base line (commit 17bef7d):
multireadrandom : 104.173 micros/op 307167 ops/sec; (5462999 of 5462999 found)
This PR:
multireadrandom : 104.199 micros/op 307095 ops/sec; (5307999 of 5307999 found)

.\db_bench --db=r:\rocksdb.github --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --cache_size=2147483648 --cache_numshardbits=6 --compression_type=none --compression_ratio=1 --min_level_to_compress=-1 --disable_seek_compaction=1 --hard_rate_limit=2 --write_buffer_size=134217728 --max_write_buffer_number=2 --level0_file_num_compaction_trigger=8 --target_file_size_base=134217728 --max_bytes_for_level_base=1073741824 --disable_wal=0 --wal_dir=r:\rocksdb.github\WAL_LOG --sync=0 --verify_checksum=1 --statistics=0 --stats_per_interval=0 --stats_interval=1048576 --histogram=0 --use_plain_table=1 --open_files=-1 --memtablerep=prefix_hash --bloom_bits=10 --bloom_locality=1 --duration=600 --benchmarks=multireadrandom --use_existing_db=1 --num=25000000 --threads=32 --allow_concurrent_memtable_write=0

@hliu18 hliu18 requested a review from riversand963 March 4, 2020 18:24
@hliu18 hliu18 force-pushed the multiget-return-ts branch 6 times, most recently from 9d3cde0 to bc61f9a Compare March 10, 2020 06:23
@hliu18
Copy link
Contributor Author

hliu18 commented Mar 10, 2020

@riversand963 Can you please help review this PR? thanks.

@hliu18 hliu18 force-pushed the multiget-return-ts branch 7 times, most recently from 86be63d to 96213e9 Compare March 16, 2020 21:24
Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

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

Thanks @hliu18 for the contribution. I left some comments.

db/db_basic_test.cc Outdated Show resolved Hide resolved
db/db_basic_test.cc Show resolved Hide resolved
db/db_impl/db_impl.h Show resolved Hide resolved
db/db_impl/db_impl.h Outdated Show resolved Hide resolved
db/db_impl/db_impl.h Show resolved Hide resolved
include/rocksdb/db.h Show resolved Hide resolved
db/db_impl/db_impl.h Outdated Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@riversand963
Copy link
Contributor

cc @anand1976 since it is related to MultiGet.

Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @hliu18 for the PR. Two more minor comments and we are good to go, unless @anand1976 has more comment.

db/db_with_timestamp_basic_test.cc Outdated Show resolved Hide resolved
include/rocksdb/db.h Show resolved Hide resolved
@riversand963
Copy link
Contributor

There are some test failures that need to be investigated before landing.

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

@hliu18
Copy link
Contributor Author

hliu18 commented Mar 18, 2020

AppVeyor build failed due to timeout on VS 2017. It passed on VS 2017.

Travis CI build failed with error "db_basic_test.cc:1705: undefined reference to `rocksdb::BlockBasedTable::kMultiGetReadStackBufSize'". It's not related to this change, and the code has been there since last year. It's not obvious to me why the build complains now. It's not on Windows.
@anand1976 do you have an idea?

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@riversand963
Copy link
Contributor

@hliu18 I re-triggered the Travis build, but I am not sure about why some of them failed. Let's see if they occur again.
@anand1976 , if this looks good to you, could you accept that on Phabricator so that it can later be landed? Thanks!

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@@ -1701,8 +1702,8 @@ TEST_F(DBBasicTest, MultiGetIOBufferOverrun) {
BlockBasedTableOptions table_options;
table_options.pin_l0_filter_and_index_blocks_in_cache = true;
table_options.block_size = 16 * 1024;
assert(table_options.block_size >
BlockBasedTable::kMultiGetReadStackBufSize);
ASSERT_GT(table_options.block_size,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change caused the failure. I am not sure why, but you can revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I found out it too. I'm going to use ASSERT_TRUE() instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please disregard my previous comment (deleted)

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@hliu18 has updated the pull request. Re-import the pull request

@hliu18
Copy link
Contributor Author

hliu18 commented Mar 24, 2020

I see it's checked in. Thanks. @riversand963

@facebook-github-bot
Copy link
Contributor

@riversand963 merged this pull request in a6ce5c8.

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

Successfully merging this pull request may close these issues.

None yet

3 participants