1. 22 4月, 2020 2 次提交
  2. 21 4月, 2020 5 次提交
    • A
      Prevent uninitialized load in `IndexBlockIter` (#6736) · f9155a34
      Andrew Kryczka 提交于
      Summary:
      When index block is empty or an error happens while reading it,
      `Invalidate()` is called rather than `Initialize()`. So `Seek()` must
      not refer to member variables that are only initialized in
      `Initialize()` until it is sure `Initialize()` has been called.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6736
      
      Reviewed By: siying
      
      Differential Revision: D21139641
      
      Pulled By: ajkr
      
      fbshipit-source-id: 71c58cc1adbd795dc3729dd5023bf7df1515ff32
      f9155a34
    • A
      Set max_background_flushes dynamically (#6701) · 03a1d95d
      Akanksha Mahajan 提交于
      Summary:
      1. Add changes so that max_background_flushes can be set dynamically.
                         2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the
                              max_background_flushes dynamically using SetDBOptions.
      
      TestPlan:  1. make -j64 check
                        2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6701
      
      Reviewed By: ajkr
      
      Differential Revision: D21028010
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 5f949e4a8fd3c32537b637947b7ee09a69cfc7c1
      03a1d95d
    • P
      C++20 compatibility (#6697) · 31da5e34
      Peter Dillinger 提交于
      Summary:
      Based on https://github.com/facebook/rocksdb/issues/6648 (CLA Signed), but heavily modified / extended:
      
      * Implicit capture of this via [=] deprecated in C++20, and [=,this] not standard before C++20 -> now using explicit capture lists
      * Implicit copy operator deprecated in gcc 9 -> add explicit '= default' definition
      * std::random_shuffle deprecated in C++17 and removed in C++20 -> migrated to a replacement in RocksDB random.h API
      * Add the ability to build with different std version though -DCMAKE_CXX_STANDARD=11/14/17/20 on the cmake command line
      * Minimal rebuild flag of MSVC is deprecated and is forbidden with /std:c++latest (C++20)
      * Added MSVC 2019 C++11 & MSVC 2019 C++20 in AppVeyor
      * Added GCC 9 C++11 & GCC9 C++20 in Travis
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6697
      
      Test Plan: make check and CI
      
      Reviewed By: cheng-chang
      
      Differential Revision: D21020318
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 12311be5dbd8675a0e2c817f7ec50fa11c18ab91
      31da5e34
    • S
      crash_test to cover index_type kBinarySearchWithFirstKey (#6721) · fe206f4f
      sdong 提交于
      Summary:
      Recently index_type kBinarySearchWithFirstKey is improved so that the API guarantee is exactly the same as other types and it is ready for wide production. We should cover it in crash tst.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6721
      
      Test Plan: Run crash_test
      
      Reviewed By: anand1976
      
      Differential Revision: D21099781
      
      fbshipit-source-id: fda91eba831d9eacbb140c703e9768bb1701f935
      fe206f4f
    • P
      Fix tabs and lint-ignores (#6734) · 45d2b4ef
      Peter Dillinger 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6734
      
      Reviewed By: cheng-chang
      
      Differential Revision: D21134556
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 3636cc1d1333137b70031f8277458781c21631fb
      45d2b4ef
  3. 18 4月, 2020 2 次提交
    • Y
      Add IsDirectory() to Env and FS (#6711) · 243852ec
      Yanqin Jin 提交于
      Summary:
      IsDirectory() is a common API to check whether a path is a regular file or
      directory.
      POSIX: call stat() and use S_ISDIR(st_mode)
      Windows: PathIsDirectoryA() and PathIsDirectoryW()
      HDFS: FileSystem.IsDirectory()
      Java: File.IsDirectory()
      ...
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6711
      
      Test Plan: make check
      
      Reviewed By: anand1976
      
      Differential Revision: D21053520
      
      Pulled By: riversand963
      
      fbshipit-source-id: 680aadfd8ce982b63689190cf31b3145d5a89e27
      243852ec
    • S
      crash_test to cover small max_open_files (#6719) · 63d82e57
      sdong 提交于
      Summary:
      RocksDB behavior is different while max_open_files is small or large. Add the coverage to small max_open_files.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6719
      
      Test Plan: Run crash_test
      
      Reviewed By: pdillinger
      
      Differential Revision: D21081021
      
      fbshipit-source-id: e3e211761a9bd25d93d19a61c1f7b62d48cf5e3c
      63d82e57
  4. 17 4月, 2020 7 次提交
    • N
      Add RocksIterator::Refresh (#6573) · 9e6f3efc
      Nicolas Pépin-Perreault 提交于
      Summary:
      This PR exposes the `Iterator::Refresh` method to the Java API by adding it on the `RocksIteratorInterface` interface. There are three concrete implementations: `RocksIterator`, `SstFileReaderIterator`, and `WBWIRocksIterator`. For the first two cases, the JNI side simply delegates to the underlying `Iterator::Refresh` method; in the last case, as it doesn't share an ancestor, and per the discussion in https://github.com/facebook/rocksdb/issues/3465, a `Status::NotSupported` exception is thrown.
      
      As the last PR had no activity in a while, I'm opening a new one - I'm completely fine with merging the previous PR if it gets completed before this is reviewed.
      
      Let me know if there's anything missing or anything else I can do 👍
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6573
      
      Reviewed By: cheng-chang
      
      Differential Revision: D20604666
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 4de17df1180c3b87b76cfdd77b674b81fc0563f7
      9e6f3efc
    • A
      Keep building RocksJava on all architectures (#6583) · 9ca49bd4
      Adam Retter 提交于
      Summary:
      Adding solid support for multiple architectures was initially triggered by RocksJava users. As such I would like to keep the CI for RocksJava on all architectures, to ensure we don't break backwards compatibility.
      
      pdillinger okay let's see how long it takes to complete Travis-CI with this one...
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6583
      
      Reviewed By: cheng-chang
      
      Differential Revision: D21036718
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 97afe0db2e4c575cc0284fdc1d4cc45d5deb2272
      9ca49bd4
    • A
      Update RocksJava static version of bzip2 (#6714) · 5fef0ffd
      Adam Retter 提交于
      Summary:
      Updates the version of bzip2 used for RocksJava static builds.
      
      Please, can we also get this cherry-picked to:
      
      1. 6.7.fb
      2. 6.8.fb
      3. 6.9.fb
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6714
      
      Reviewed By: cheng-chang
      
      Differential Revision: D21067233
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 8164b7eb99c5ca7b2021ab8c371ba9ded4cb4f7e
      5fef0ffd
    • A
      Fix CF import with overlapping SST files (#6663) · 6717ada8
      Andrew Kryczka 提交于
      Summary:
      Invariant checking should use internal key comparator rather than
      `sstableKeyCompare()`. The latter was intended for checking whether a
      compaction input file's neighboring files need to be included in the
      same compaction. Using it for invariant checking was leading to false
      positives for files with overlapping endpoints.
      
      Fixes https://github.com/facebook/rocksdb/issues/6647.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6663
      
      Test Plan: regression test
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D20910466
      
      Pulled By: ajkr
      
      fbshipit-source-id: f0b70dad7c4096fce635cab7a36f16e14f74ae3f
      6717ada8
    • S
      crash_test to cover options.avoid_flush_during_recovery (#6712) · 73523bae
      sdong 提交于
      Summary:
      Options.avoid_flush_during_recovery is uncovered in crash_test. Add the coverage with a chance of 1/8, as it is a less frequently used options.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6712
      
      Test Plan: Run crash_test and see the option can be used or not used by chance.
      
      Reviewed By: ltamasi
      
      Differential Revision: D21056566
      
      fbshipit-source-id: c3b1521517cfc204786e6ef8c6acd7fffda64793
      73523bae
    • Y
      Add env_fault_injection argument to db_stress (#6687) · 5801af46
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add env_fault_injection argument to db_stress.  When enabled,
      FaultInjectionTestEnv will be used instead.  Currently this
      option does not support running with other env setting.
      
      This will allow
      us to later manually produce error when running db_crashtest.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6687
      
      Test Plan:
      make db_stress -j32
      ./db_stress --env_fault_injection
      ./db_stress --env_fault_injection --hdfs   // expect error message
      
      Reviewed By: ajkr
      
      Differential Revision: D21014683
      
      Pulled By: yhchiang
      
      fbshipit-source-id: 0724aeac37efd57adb72a37defe6dbd3bfa8106a
      5801af46
    • C
      Fix warning when O_CLOEXEC is not defined (#6695) · 27679723
      Cheng Chang 提交于
      Summary:
      Compilation fails on systems that do not support O_CLOEXEC. Fix it.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6695
      
      Test Plan: compile without O_CLOEXEC support
      
      Reviewed By: anand1976
      
      Differential Revision: D21011850
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: f1bf1cce2aa65c7d10b5a9613e941db30e928347
      27679723
  5. 16 4月, 2020 3 次提交
    • M
      Properly report IO errors when IndexType::kBinarySearchWithFirstKey is used (#6621) · e45673de
      Mike Kolupaev 提交于
      Summary:
      Context: Index type `kBinarySearchWithFirstKey` added the ability for sst file iterator to sometimes report a key from index without reading the corresponding data block. This is useful when sst blocks are cut at some meaningful boundaries (e.g. one block per key prefix), and many seeks land between blocks (e.g. for each prefix, the ranges of keys in different sst files are nearly disjoint, so a typical seek needs to read a data block from only one file even if all files have the prefix). But this added a new error condition, which rocksdb code was really not equipped to deal with: `InternalIterator::value()` may fail with an IO error or Status::Incomplete, but it's just a method returning a Slice, with no way to report error instead. Before this PR, this type of error wasn't handled at all (an empty slice was returned), and kBinarySearchWithFirstKey implementation was considered a prototype.
      
      Now that we (LogDevice) have experimented with kBinarySearchWithFirstKey for a while and confirmed that it's really useful, this PR is adding the missing error handling.
      
      It's a pretty inconvenient situation implementation-wise. The error needs to be reported from InternalIterator when trying to access value. But there are ~700 call sites of `InternalIterator::value()`, most of which either can't hit the error condition (because the iterator is reading from memtable or from index or something) or wouldn't benefit from the deferred loading of the value (e.g. compaction iterator that reads all values anyway). Adding error handling to all these call sites would needlessly bloat the code. So instead I made the deferred value loading optional: only the call sites that may use deferred loading have to call the new method `PrepareValue()` before calling `value()`. The feature is enabled with a new bool argument `allow_unprepared_value` to a bunch of methods that create iterators (it wouldn't make sense to put it in ReadOptions because it's completely internal to iterators, with virtually no user-visible effect). Lmk if you have better ideas.
      
      Note that the deferred value loading only happens for *internal* iterators. The user-visible iterator (DBIter) always prepares the value before returning from Seek/Next/etc. We could go further and add an API to defer that value loading too, but that's most likely not useful for LogDevice, so it doesn't seem worth the complexity for now.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6621
      
      Test Plan: make -j5 check . Will also deploy to some logdevice test clusters and look at stats.
      
      Reviewed By: siying
      
      Differential Revision: D20786930
      
      Pulled By: al13n321
      
      fbshipit-source-id: 6da77d918bad3780522e918f17f4d5513d3e99ee
      e45673de
    • A
      Remove a printf from db_stress that's not useful info (#6705) · 610a09cc
      anand76 提交于
      Summary:
      This was causing db_crashtest.py to wrongly assume an error by parsing the output. Hopefully this will stabilize the crash tests.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6705
      
      Test Plan: make blackbox_crash_test
      
      Reviewed By: ltamasi
      
      Differential Revision: D21043335
      
      Pulled By: anand1976
      
      fbshipit-source-id: 5cddd112b124d4e2ebd11724a17d4ef0f50c1cf8
      610a09cc
    • S
      Two Improvements to tools/check_format_compatible.sh (#6702) · 165560fb
      sdong 提交于
      Summary:
      Improve it in two ways:
      1. tools/check_format_compatible.sh is not friendly to run outside FB environment. remove the hard-coded http proxy setting. Instead, move it to Legocastle configuration
      2. Always disable warning as error, so that older build is more likely to pass.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6702
      
      Test Plan: Run the test and make sure at least it doesn't break.
      
      Reviewed By: riversand963
      
      Differential Revision: D21033329
      
      fbshipit-source-id: 88b4ec1ec49547b772790050a165466bdc4a62a0
      165560fb
  6. 15 4月, 2020 2 次提交
  7. 14 4月, 2020 6 次提交
  8. 12 4月, 2020 1 次提交
    • Y
      Fix release build (#6690) · eeb3cf3f
      Yanqin Jin 提交于
      Summary:
      Fix release build caused by variable defined but unused.
      
      Test plan (devserver)
      ```
      make release
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6690
      
      Reviewed By: cheng-chang
      
      Differential Revision: D20980571
      
      Pulled By: riversand963
      
      fbshipit-source-id: c3f3b13f81dce4bdb19876dc2e710d5902ff8a02
      eeb3cf3f
  9. 11 4月, 2020 8 次提交
  10. 10 4月, 2020 4 次提交
    • L
      Provide an allocator for new memory type to be used with RocksDB block cache (#6214) · 66a95f0f
      Luca Giacchino 提交于
      Summary:
      New memory technologies are being developed by various hardware vendors (Intel DCPMM is one such technology currently available). These new memory types require different libraries for allocation and management (such as PMDK and memkind). The high capacities available make it possible to provision large caches (up to several TBs in size), beyond what is achievable with DRAM.
      The new allocator provided in this PR uses the memkind library to allocate memory on different media.
      
      **Performance**
      
      We tested the new allocator using db_bench.
      - For each test, we vary the size of the block cache (relative to the size of the uncompressed data in the database).
      - The database is filled sequentially. Throughput is then measured with a readrandom benchmark.
      - We use a uniform distribution as a worst-case scenario.
      
      The plot shows throughput (ops/s) relative to a configuration with no block cache and default allocator.
      For all tests, p99 latency is below 500 us.
      
      ![image](https://user-images.githubusercontent.com/26400080/71108594-42479100-2178-11ea-8231-8a775bbc92db.png)
      
      **Changes**
      
      - Add MemkindKmemAllocator
      - Add --use_cache_memkind_kmem_allocator db_bench option (to create an LRU block cache with the new allocator)
      - Add detection of memkind library with KMEM DAX support
      - Add test for MemkindKmemAllocator
      
      **Minimum Requirements**
      
      - kernel 5.3.12
      - ndctl v67 - https://github.com/pmem/ndctl
      - memkind v1.10.0 - https://github.com/memkind/memkind
      
      **Memory Configuration**
      
      The allocator uses the MEMKIND_DAX_KMEM memory kind. Follow the instructions on[ memkind’s GitHub page](https://github.com/memkind/memkind) to set up NVDIMM memory accordingly.
      
      Note on memory allocation with NVDIMM memory exposed as system memory.
      - The MemkindKmemAllocator will only allocate from NVDIMM memory (using memkind_malloc with MEMKIND_DAX_KMEM kind).
      - The default allocator is not restricted to RAM by default. Based on NUMA node latency, the kernel should allocate from local RAM preferentially, but it’s a kernel decision. numactl --preferred/--membind can be used to allocate preferentially/exclusively from the local RAM node.
      
      **Usage**
      
      When creating an LRU cache, pass a MemkindKmemAllocator object as argument.
      For example (replace capacity with the desired value in bytes):
      
      ```
      #include "rocksdb/cache.h"
      #include "memory/memkind_kmem_allocator.h"
      
      NewLRUCache(
          capacity /*size_t*/,
          6 /*cache_numshardbits*/,
          false /*strict_capacity_limit*/,
          false /*cache_high_pri_pool_ratio*/,
          std::make_shared<MemkindKmemAllocator>());
      ```
      
      Refer to [RocksDB’s block cache documentation](https://github.com/facebook/rocksdb/wiki/Block-Cache) to assign the LRU cache as block cache for a database.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6214
      
      Reviewed By: cheng-chang
      
      Differential Revision: D19292435
      
      fbshipit-source-id: 7202f47b769e7722b539c86c2ffd669f64d7b4e1
      66a95f0f
    • P
      Temporarily disable ppc64le unit tests in PRs (#6682) · 9d6974d3
      Peter Dillinger 提交于
      Summary:
      Until Travis gets its act together (https://github.com/facebook/rocksdb/issues/6653)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6682
      
      Test Plan: CI
      
      Reviewed By: riversand963
      
      Differential Revision: D20948865
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 215de523c91a83d2a159f466b853e700c925ba4f
      9d6974d3
    • S
      Fix memory corruption caused by new test in options_settable_test (#6676) · e860f884
      sdong 提交于
      Summary:
      https://github.com/facebook/rocksdb/pull/6668 added some new test code but it has a risk of memory corruption. Fix it
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6676
      
      Test Plan: Run the test under ASAN and see it passes.
      
      Reviewed By: ajkr
      
      Differential Revision: D20937108
      
      fbshipit-source-id: 22cc96bb02030df0a37a02e67a2cc37ca31ba22d
      e860f884
    • C
      Add two more optimization improvements to HISTORY (#6679) · 6e6f8079
      Cheng Chang 提交于
      Summary:
      Although these optimizations are not user facing, still feel it's valuable to call out in HISTORY.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6679
      
      Test Plan: no need
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D20945916
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: f3e790c07f3bcc4a8a74246c4fa232800ddd4438
      6e6f8079