]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix bug in pinned partitioned indexes with some reads bypassing block cache
authorAndrew Kryczka <andrewkr@fb.com>
Mon, 12 Oct 2020 19:42:58 +0000 (12:42 -0700)
committerAndrew Kryczka <andrewkr@fb.com>
Mon, 12 Oct 2020 20:55:59 +0000 (13:55 -0700)
Backports part of 75d3b6fdf0aa1007c4d26382f65be0adf4519a37.

HISTORY.md
table/block_based/partitioned_index_reader.cc

index b2d855db26bc6c56909da2e1555f7563c3504cbd..c4cd886d6c2fb78595135bdf33119da5563d59e8 100644 (file)
@@ -3,6 +3,7 @@
 ### Bug Fixes
 * Since 6.12, memtable lookup should report unrecognized value_type as corruption (#7121).
 * Fixed a bug in the following combination of features: indexes with user keys (`format_version >= 3`), indexes are partitioned (`index_type == kTwoLevelIndexSearch`), and some index partitions are pinned in memory (`BlockBasedTableOptions::pin_l0_filter_and_index_blocks_in_cache`). The bug could cause keys to be truncated when read from the index leading to wrong read results or other unexpected behavior.
+* Fixed a bug when indexes are partitioned (`index_type == kTwoLevelIndexSearch`), some index partitions are pinned in memory (`BlockBasedTableOptions::pin_l0_filter_and_index_blocks_in_cache`), and partitions reads could be mixed between block cache and directly from the file (e.g., with `enable_index_compression == 1` and `mmap_read == 1`, partitions that were stored uncompressed due to poor compression ratio would be read directly from the file via mmap, while partitions that were stored compressed would be read from block cache). The bug could cause index partitions to be mistakenly considered empty during reads leading to wrong read results.
 
 ## 6.13 (09/24/2020)
 ### Bug fixes
index 89c16f65b92076fe5664a7338a2791e041f01cad..d60e93de2220014348449e85cdccd3be2b13c77a 100644 (file)
@@ -173,7 +173,7 @@ Status PartitionIndexReader::CacheDependencies(const ReadOptions& ro,
       return s;
     }
     if (block.GetValue() != nullptr) {
-      if (block.IsCached()) {
+      if (block.IsCached() || block.GetOwnValue()) {
         if (pin) {
           partition_map_[handle.offset()] = std::move(block);
         }