summaryrefslogtreecommitdiff
path: root/table
diff options
context:
space:
mode:
authoranand76 <anand76@devvm1373.frc2.facebook.com>2020-08-07 11:59:19 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2020-08-07 12:01:08 -0700
commit832b056a302b47ef7d85c366a1012562863f9c11 (patch)
tree63419146adabe0f7effb7003975af47b65038259 /table
parentb79f13b2aaabb8ed74f70138905c2392841bb030 (diff)
Enable IO timeouts for iterators (#7161)
Summary: Introduce io_timeout in ReadOptions and enabled deadline/io_timeout for Iterators. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7161 Test Plan: New unit tests in db_basic_test Reviewed By: riversand963 Differential Revision: D22687352 Pulled By: anand1976 fbshipit-source-id: 67bbb0e6d7ae80b256589244468494292538c6ec
Diffstat (limited to 'table')
-rw-r--r--table/block_based/block_based_table_reader.cc4
-rw-r--r--table/block_based/partitioned_index_reader.cc1
2 files changed, 4 insertions, 1 deletions
diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc
index ddbec3560..66b4c6ddb 100644
--- a/table/block_based/block_based_table_reader.cc
+++ b/table/block_based/block_based_table_reader.cc
@@ -595,12 +595,14 @@ Status BlockBasedTable::Open(
Footer footer;
std::unique_ptr<FilePrefetchBuffer> prefetch_buffer;
- // Only retain read_options.deadline. In future, we may retain more
+ // Only retain read_options.deadline and read_options.io_timeout.
+ // In future, we may retain more
// options. Specifically, w ignore verify_checksums and default to
// checksum verification anyway when creating the index and filter
// readers.
ReadOptions ro;
ro.deadline = read_options.deadline;
+ ro.io_timeout = read_options.io_timeout;
// prefetch both index and filters, down to all partitions
const bool prefetch_all = prefetch_index_and_filter_in_cache || level == 0;
diff --git a/table/block_based/partitioned_index_reader.cc b/table/block_based/partitioned_index_reader.cc
index e8cfd0cf6..c120c26ea 100644
--- a/table/block_based/partitioned_index_reader.cc
+++ b/table/block_based/partitioned_index_reader.cc
@@ -78,6 +78,7 @@ InternalIteratorBase<IndexValue>* PartitionIndexReader::NewIterator(
ReadOptions ro;
ro.fill_cache = read_options.fill_cache;
ro.deadline = read_options.deadline;
+ ro.io_timeout = read_options.io_timeout;
// We don't return pinned data from index blocks, so no need
// to set `block_contents_pinned`.
std::unique_ptr<InternalIteratorBase<IndexValue>> index_iter(