1. 19 6月, 2019 6 次提交
  2. 18 6月, 2019 8 次提交
    • Z
      fix rocksdb lite and clang contrun test failures (#5477) · ddd088c8
      Zhongyi Xie 提交于
      Summary:
      recent commit 671d15cb introduced some test failures:
      ```
      ===== Running stats_history_test
      [==========] Running 9 tests from 1 test case.
      [----------] Global test environment set-up.
      [----------] 9 tests from StatsHistoryTest
      [ RUN      ] StatsHistoryTest.RunStatsDumpPeriodSec
      monitoring/stats_history_test.cc:63: Failure
      dbfull()->SetDBOptions({{"stats_dump_period_sec", "0"}})
      Not implemented: Not supported in ROCKSDB LITE
      
      db/db_options_test.cc:28:11: error: unused variable 'kMicrosInSec' [-Werror,-Wunused-const-variable]
      const int kMicrosInSec = 1000000;
      ```
      This PR fixes these failures
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5477
      
      Differential Revision: D15871814
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 0a7023914d2c1784d9d2d3f5bfb47310d4855394
      ddd088c8
    • H
      Block cache tracing: Fix minor bugs with downsampling and some benchmark results. (#5473) · bcfc53b4
      haoyuhuang 提交于
      Summary:
      As the code changes for block cache tracing are almost complete, I did a benchmark to compare the performance when block cache tracing is enabled/disabled.
      
       With 1% downsampling ratio, the performance overhead of block cache tracing is negligible. When we trace all block accesses, the throughput drops by 6 folds with 16 threads issuing random reads and all reads are served in block cache.
      
      Setup:
      RocksDB:    version 6.2
      Date:       Mon Jun 17 17:11:13 2019
      CPU:        24 * Intel Core Processor (Skylake)
      CPUCache:   16384 KB
      Keys:       20 bytes each
      Values:     100 bytes each (100 bytes after compression)
      Entries:    10000000
      Prefix:    20 bytes
      Keys per prefix:    0
      RawSize:    1144.4 MB (estimated)
      FileSize:   1144.4 MB (estimated)
      Write rate: 0 bytes/second
      Read rate: 0 ops/second
      Compression: NoCompression
      Compression sampling rate: 0
      Memtablerep: skip_list
      Perf Level: 1
      
      I ran the readrandom workload for 1 minute. Detailed throughput results:  (ops/second)
      Sample rate 0: no block cache tracing.
      Sample rate 1: trace all block accesses.
      Sample rate 100: trace accesses 1% blocks.
      1 thread |   |   |  -- | -- | -- | --
      Sample rate | 0 | 1 | 100
      1 MB block cache size | 13,094 | 13,166 | 13,341
      10 GB block cache size | 202,243 | 188,677 | 229,182
      
      16 threads |   |   |  -- | -- | -- | --
      Sample rate | 0 | 1 | 100
      1 MB block cache size | 208,761 | 178,700 | 201,872
      10 GB block cache size | 2,645,996 | 426,295 | 2,587,605
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5473
      
      Differential Revision: D15869479
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: 7ae802abe84811281a6af8649f489887cd7c4618
      bcfc53b4
    • H
      Support computing miss ratio curves using sim_cache. (#5449) · 2d1dd5bc
      haoyuhuang 提交于
      Summary:
      This PR adds a BlockCacheTraceSimulator that reports the miss ratios given different cache configurations. A cache configuration contains "cache_name,num_shard_bits,cache_capacities". For example, "lru, 1, 1K, 2K, 4M, 4G".
      
      When we replay the trace, we also perform lookups and inserts on the simulated caches.
      In the end, it reports the miss ratio for each tuple <cache_name, num_shard_bits, cache_capacity> in a output file.
      
      This PR also adds a main source block_cache_trace_analyzer so that we can run the analyzer in command line.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5449
      
      Test Plan:
      Added tests for block_cache_trace_analyzer.
      COMPILE_WITH_ASAN=1 make check -j32.
      
      Differential Revision: D15797073
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: aef0c5c2e7938f3e8b6a10d4a6a50e6928ecf408
      2d1dd5bc
    • Y
      Override check consistency for DBImplSecondary (#5469) · 7d8d5641
      Yanqin Jin 提交于
      Summary:
      `DBImplSecondary` calls `CheckConsistency()` during open. In the past, `DBImplSecondary` did not override this function thus `DBImpl::CheckConsistency()` is called.
      The following can happen. The secondary instance is performing consistency check which calls `GetFileSize(file_path)` but the file at `file_path` is deleted by the primary instance. `DBImpl::CheckConsistency` does not account for this and fails the consistency check. This is undesirable. The solution is that, we call `DBImpl::CheckConsistency()` first. If it passes, then we are good. If not, we give it a second chance and handles the case of file(s) being deleted.
      
      Test plan (on dev server):
      ```
      $make clean && make -j20 all
      $./db_secondary_test
      ```
      All other existing unit tests must pass as well.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5469
      
      Differential Revision: D15861845
      
      Pulled By: riversand963
      
      fbshipit-source-id: 507d72392508caed3cd003bb2e2aa43f993dd597
      7d8d5641
    • Z
      Persistent Stats: persist stats history to disk (#5046) · 671d15cb
      Zhongyi Xie 提交于
      Summary:
      This PR continues the work in https://github.com/facebook/rocksdb/pull/4748 and https://github.com/facebook/rocksdb/pull/4535 by adding a new DBOption `persist_stats_to_disk` which instructs RocksDB to persist stats history to RocksDB itself. When statistics is enabled, and  both options `stats_persist_period_sec` and `persist_stats_to_disk` are set, RocksDB will periodically write stats to a built-in column family in the following form: key -> (timestamp in microseconds)#(stats name), value -> stats value. The existing API `GetStatsHistory` will detect the current value of `persist_stats_to_disk` and either read from in-memory data structure or from the hidden column family on disk.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5046
      
      Differential Revision: D15863138
      
      Pulled By: miasantreble
      
      fbshipit-source-id: bb82abdb3f2ca581aa42531734ac799f113e931b
      671d15cb
    • M
      Make db_bloom_filter_test parallel (#5467) · ee294c24
      Maysam Yabandeh 提交于
      Summary:
      When run under TSAN it sometimes goes over 10m and times out. The slowest ones are `DBBloomFilterTestWithParam.BloomFilter` which we have 6 of them. Making the tests run in parallel should take care of the timeout issue.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5467
      
      Differential Revision: D15856912
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 26c43c55312974c1b809c070342dee037d0219f4
      ee294c24
    • H
      Integrate block cache tracing into db_bench (#5459) · d43b4cd5
      haoyuhuang 提交于
      Summary:
      This PR integrates the block cache tracing into db_bench. It adds three command line arguments.
      -block_cache_trace_file (Block cache trace file path.) type: string default: ""
      -block_cache_trace_max_trace_file_size_in_bytes (The maximum block cache
      trace file size in bytes. Block cache accesses will not be logged if the
      trace file size exceeds this threshold. Default is 64 GB.) type: int64
      default: 68719476736
      -block_cache_trace_sampling_frequency (Block cache trace sampling
      frequency, termed s. It uses spatial downsampling and samples accesses to
      one out of s blocks.) type: int32 default: 1
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5459
      
      Differential Revision: D15832031
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: 0ecf2f2686557251fe741a2769b21170777efa3d
      d43b4cd5
    • A
      Switch Travis to Xenial build (#4789) · d1ae67bd
      Adam Retter 提交于
      Summary:
      I think this should now also run on Travis's new virtualised infrastructure which affords more memory and CPU.
      
      We also need to think about migrating from travis-ci.org to travis-ci.com.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4789
      
      Differential Revision: D15856272
      
      fbshipit-source-id: 10b41d21924e8a362bc9646a63ccd1a5dfc437c6
      d1ae67bd
  3. 15 6月, 2019 5 次提交
    • H
      Integrate block cache tracer in block based table reader. (#5441) · 7a8d7358
      haoyuhuang 提交于
      Summary:
      This PR integrates the block cache tracer into block based table reader. The tracer will write the block cache accesses using the trace_writer. The tracer is null in this PR so that nothing will be logged.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5441
      
      Differential Revision: D15772029
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: a64adb92642cd23222e0ba8b10d86bf522b42f9b
      7a8d7358
    • S
      Validate CF Options when creating a new column family (#5453) · f1219644
      Sagar Vemuri 提交于
      Summary:
      It seems like CF Options are not properly validated  when creating a new column family with `CreateColumnFamily` API; only a selected few checks are done. Calling `ColumnFamilyData::ValidateOptions`, which is the single source for all CFOptions validations,  will help fix this. (`ColumnFamilyData::ValidateOptions` is already called at the time of `DB::Open`).
      
      **Test Plan:**
      Added a new test: `DBTest.CreateColumnFamilyShouldFailOnIncompatibleOptions`
      ```
      TEST_TMPDIR=/dev/shm ./db_test --gtest_filter=DBTest.CreateColumnFamilyShouldFailOnIncompatibleOptions
      ```
      Also ran gtest-parallel to make sure the new test is not flaky.
      ```
      TEST_TMPDIR=/dev/shm ~/gtest-parallel/gtest-parallel ./db_test --gtest_filter=DBTest.CreateColumnFamilyShouldFailOnIncompatibleOptions --repeat=10000
      [10000/10000] DBTest.CreateColumnFamilyShouldFailOnIncompatibleOptions (15 ms)
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5453
      
      Differential Revision: D15816851
      
      Pulled By: sagar0
      
      fbshipit-source-id: 9e702b9850f5c4a7e0ef8d39e1e6f9b81e7fe1e5
      f1219644
    • H
      fix compilation error on MSVC (#5458) · b47cfec5
      Huisheng Liu 提交于
      Summary:
      "__attribute__((__weak__))" was introduced in port\jemalloc_helper.h. It's not supported by Microsoft VS 2015, resulting in compile error. This fix adds a #if branch to work around the compile issue.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5458
      
      Differential Revision: D15827285
      
      fbshipit-source-id: 8c5f7ad31de1ac677bd96f16c4450767de834beb
      b47cfec5
    • M
      Set executeLocal on child lego jobs (#5456) · 58c78358
      Maysam Yabandeh 提交于
      Summary:
      This property is needed to run the child jobs on the same host and thus propagate the child job status back to the parent's.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5456
      
      Reviewed By: yancouto
      
      Differential Revision: D15824382
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 42f2efbedaa3a8b399281105f0ce793c1c9a6191
      58c78358
    • H
      Remove unused variable (#5457) · 89695bfb
      haoyuhuang 提交于
      Summary:
      This PR removes the unused variable that causes CLANG build to fail.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5457
      
      Differential Revision: D15825027
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: 72c847c39ca310560efcbc5938cffa6f31164068
      89695bfb
  4. 14 6月, 2019 5 次提交
  5. 13 6月, 2019 4 次提交
  6. 12 6月, 2019 6 次提交
  7. 11 6月, 2019 6 次提交
    • L
      Fix DBTest.DynamicMiscOptions so it passes even with Snappy disabled (#5438) · a94aef65
      Levi Tamasi 提交于
      Summary:
      This affects our "no compression" automated tests. Since PR #5368, DBTest.DynamicMiscOptions has been failing with:
      
      db/db_test.cc:4889: Failure
      dbfull()->SetOptions({{"compression", "kSnappyCompression"}})
      Invalid argument: Compression type Snappy is not linked with the binary.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5438
      
      Differential Revision: D15752100
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 3f19eff7cafc03b333965be0203c5853d2a9cb71
      a94aef65
    • M
      Avoid deadlock between mutex_ and log_write_mutex_ (#5437) · c8c1a549
      Maysam Yabandeh 提交于
      Summary:
      To avoid deadlock mutex_ should never be acquired before log_write_mutex_. The patch documents that and also fixes one case in ::FlushWAL that acquires mutex_ through ::WriteStatusCheck when it already holds lock on log_write_mutex_.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5437
      
      Differential Revision: D15749722
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: f57b69c44b4b80cc6d7ddf3d3fdf4a9eb5a5a45a
      c8c1a549
    • M
      Remove global locks from FlushScheduler (#5372) · b2584577
      Maysam Yabandeh 提交于
      Summary:
      FlushScheduler's methods are instrumented with debug-time locks to check the scheduler state against a simple container definition. Since https://github.com/facebook/rocksdb/pull/2286 the scope of such locks are widened to the entire methods' body. The result is that the concurrency tested during testing (in debug mode) is stricter than the concurrency level manifested at runtime (in release mode).
      The patch reverts this change to reduce the scope of such locks.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5372
      
      Differential Revision: D15545831
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 01d69191afb1dd807d4bdc990fc74813ae7b5426
      b2584577
    • Y
      Use CreateLoggerFromOptions function (#5427) · 641cc8d5
      Yanqin Jin 提交于
      Summary:
      Use `CreateLoggerFromOptions` function to reduce code duplication.
      
      Test plan (on my machine)
      ```
      $make clean && make -j32 db_secondary_test
      $KEEP_DB=1 ./db_secondary_test
      ```
      Verify all info logs of the secondary instance are properly logged.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5427
      
      Differential Revision: D15748922
      
      Pulled By: riversand963
      
      fbshipit-source-id: bad7261df1b8373efc504f141efc7871e375a311
      641cc8d5
    • H
      Create a BlockCacheLookupContext to enable fine-grained block cache tracing. (#5421) · 5efa0d6b
      haoyuhuang 提交于
      Summary:
      BlockCacheLookupContext only contains the caller for now.
      We will trace block accesses at five places:
      1. BlockBasedTable::GetFilter.
      2. BlockBasedTable::GetUncompressedDict.
      3. BlockBasedTable::MaybeReadAndLoadToCache. (To trace access on data, index, and range deletion block.)
      4. BlockBasedTable::Get. (To trace the referenced key and whether the referenced key exists in a fetched data block.)
      5. BlockBasedTable::MultiGet. (To trace the referenced key and whether the referenced key exists in a fetched data block.)
      
      We create the context at:
      1. BlockBasedTable::Get. (kUserGet)
      2. BlockBasedTable::MultiGet. (kUserMGet)
      3. BlockBasedTable::NewIterator. (either kUserIterator, kCompaction, or external SST ingestion calls this function.)
      4. BlockBasedTable::Open. (kPrefetch)
      5. Index/Filter::CacheDependencies. (kPrefetch)
      6. BlockBasedTable::ApproximateOffsetOf. (kCompaction or kUserApproximateSize).
      
      I loaded 1 million key-value pairs into the database and ran the readrandom benchmark with a single thread. I gave the block cache 10 GB to make sure all reads hit the block cache after warmup. The throughput is comparable.
      Throughput of this PR: 231334 ops/s.
      Throughput of the master branch: 238428 ops/s.
      
      Experiment setup:
      RocksDB:    version 6.2
      Date:       Mon Jun 10 10:42:51 2019
      CPU:        24 * Intel Core Processor (Skylake)
      CPUCache:   16384 KB
      Keys:       20 bytes each
      Values:     100 bytes each (100 bytes after compression)
      Entries:    1000000
      Prefix:    20 bytes
      Keys per prefix:    0
      RawSize:    114.4 MB (estimated)
      FileSize:   114.4 MB (estimated)
      Write rate: 0 bytes/second
      Read rate: 0 ops/second
      Compression: NoCompression
      Compression sampling rate: 0
      Memtablerep: skip_list
      Perf Level: 1
      
      Load command: ./db_bench --benchmarks="fillseq" --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --statistics --cache_index_and_filter_blocks --cache_size=10737418240 --disable_auto_compactions=1 --disable_wal=1 --compression_type=none --min_level_to_compress=-1 --compression_ratio=1 --num=1000000
      
      Run command: ./db_bench --benchmarks="readrandom,stats" --use_existing_db --threads=1 --duration=120 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --statistics --cache_index_and_filter_blocks --cache_size=10737418240 --disable_auto_compactions=1 --disable_wal=1 --compression_type=none --min_level_to_compress=-1 --compression_ratio=1 --num=1000000 --duration=120
      
      TODOs:
      1. Create a caller for external SST file ingestion and differentiate the callers for iterator.
      2. Integrate tracer to trace block cache accesses.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5421
      
      Differential Revision: D15704258
      
      Pulled By: HaoyuHuang
      
      fbshipit-source-id: 4aa8a55f8cb1576ffb367bfa3186a91d8f06d93a
      5efa0d6b
    • A
      Reuse data block iterator in BlockBasedTableReader::MultiGet() (#5314) · 63ace8ef
      anand76 提交于
      Summary:
      Instead of creating a new DataBlockIterator for every key in a MultiGet batch, reuse it if the next key is in the same block. This results in a small 1-2% cpu improvement.
      
      TEST_TMPDIR=/dev/shm/multiget numactl -C 10  ./db_bench.tmp -use_existing_db=true -benchmarks="readseq,multireadrandom" -write_buffer_size=4194304 -target_file_size_base=4194304 -max_bytes_for_level_base=16777216 -num=12000000 -reads=12000000 -duration=90 -threads=1 -compression_type=none -cache_size=4194304000 -batch_size=32 -disable_auto_compactions=true -bloom_bits=10 -cache_index_and_filter_blocks=true -pin_l0_filter_and_index_blocks_in_cache=true -multiread_batched=true -multiread_stride=4
      
      Without the change -
      multireadrandom :       3.066 micros/op 326122 ops/sec; (29375968 of 29375968 found)
      
      With the change -
      multireadrandom :       3.003 micros/op 332945 ops/sec; (29983968 of 29983968 found)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5314
      
      Differential Revision: D15742108
      
      Pulled By: anand1976
      
      fbshipit-source-id: 220fb0b8eea9a0d602ddeb371528f7af7936d771
      63ace8ef