1. 13 8月, 2020 7 次提交
    • S
      Upgrade tool chain (#7251) · e7358da9
      sdong 提交于
      Summary:
      Upgrade tool chain to the latest. It is done mostly manually as build_tools/build_detect_platform fails to update many of them.
      
      Try to fix a new clang analyze warning with the new tool chain.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7251
      
      Test Plan: "make all", "USE_CLANG=1 make all"
      
      Reviewed By: riversand963
      
      Differential Revision: D23091090
      
      fbshipit-source-id: 732e5a30137837431438f85f36296406b641f975
      e7358da9
    • L
      Clean up CompressBlock/CompressBlockInternal a bit (#7249) · 9d6f48ec
      Levi Tamasi 提交于
      Summary:
      The patch cleans up and refactors `CompressBlock` and `CompressBlockInternal` a bit.
      In particular, it does the following:
      * It renames `CompressBlockInternal` to `CompressData` and moves it to `util/compression.h`,
      where other general compression-related utilities are located. This will facilitate reuse in the
      BlobDB write path.
      * The signature of the method is changed so it now takes `compression_format_version`
      (similarly to the compression library specific methods) instead of `format_version` (which is
      specific to the block based table).
      * `GetCompressionFormatForVersion` no longer takes `compression_type` as a parameter.
      This parameter was only used in a (not entirely up-to-date) assertion; also, removing it
      eliminates the need to ensure this precondition holds at all call sites.
      * Does some minor cleanup in `CompressBlock`, for instance, it is now possible to pass
      only one of `sampled_output_fast` and `sampled_output_slow`.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7249
      
      Test Plan: `make check`
      
      Reviewed By: riversand963
      
      Differential Revision: D23087278
      
      Pulled By: ltamasi
      
      fbshipit-source-id: e6316e45baed8b4e7de7c1780c90501c2a3439b3
      9d6f48ec
    • A
      Store FileSystemPtr object that contains FileSystem ptr (#7180) · 1f9f630b
      Akanksha Mahajan 提交于
      Summary:
      As part of the IOTracing project, this PR
          1. Caches "FileSystemPtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FileSystem" pointer.
          2. FileSystemPtr object is created using FileSystem pointer and IOTracer
          pointer.
          3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor.
          4. When tracing is enabled through DB::StartIOTrace, FileSystemPtr
          returns FileSystemTracingWrapper pointer for tracing purpose and when
          it is disabled underlying FileSystem pointer is returned.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7180
      
      Test Plan:
      make check -j64
                      COMPILE_WITH_TSAN=1 make check -j64
      
      Reviewed By: anand1976
      
      Differential Revision: D22987117
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 6073617e4c2d5bc363914f3a1f55ae3b0a58fbf1
      1f9f630b
    • A
      Fix Java test for uint64add merge operator (#7243) · 2bc63e3a
      Arkady Dyakonov 提交于
      Summary:
      The PR fixes a Java test for Merge operator `uint64add`.
      
      The current implementation uses wrong byte order for long serialization, but fails to catch this error because the merge sum is lower than `256`.
      
      The PR makes this test case more representative (i.e. it fails with wrong byte order) and changes the byte order to little endian.
      
      Some background: RocksDB uses LittleEndian byte order for integer serialization across all platforms. `MergeTest` uses `ByteBuffer` that defaults to BigEndian byte order.
      
      This test case might probably be used as a sample of `MergeOperator` usage in Java.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7243
      
      Reviewed By: ajkr
      
      Differential Revision: D23079593
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 82e8e166901d66733e96a0116f88d0ec4761ddf1
      2bc63e3a
    • Z
      BackupEngine supports custom file checksums (#7085) · b578ca2e
      Zitan Chen 提交于
      Summary:
      A new option `std::shared_ptr<FileChecksumGenFactory> backup_checksum_gen_factory` is added to `BackupableDBOptions`. This allows custom checksum functions to be used for creating, verifying, or restoring backups.
      
      Tests are added.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7085
      
      Test Plan: Passed make check
      
      Reviewed By: pdillinger
      
      Differential Revision: D22390756
      
      Pulled By: gg814
      
      fbshipit-source-id: 3b7756ca444c2129844536b91c3ca09f53b6248f
      b578ca2e
    • Y
      Fix potential memory leak (#7245) · 76609cd3
      Yanqin Jin 提交于
      Summary:
      ```
      int* value = new int;
      ASSERT_NE(nullptr, value);
      ```
      `ASSERT_NE` can expand the expression such that a memory leak is
      reported by clang analyzer.
      We can remove this ASSERT_NE since we can assume the memory allocation
      must succeed. Otherwise a bad alloc exception will be thrown and the
      process will be killed anyway.
      
      Test plan (dev server):
      ```
      USE_CLANG=1 make analyze
      ```
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7245
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D23079641
      
      Pulled By: riversand963
      
      fbshipit-source-id: a6739a903f90f8715f6f1ef3e5c8a329245b8e78
      76609cd3
    • L
      Update github-pages to v207 (#7235) · 378bc94d
      Levi Tamasi 提交于
      Summary:
      The patch updates github-pages to the latest version. Dependencies were
      updated using `bundle update`. Also, the deprecated option `gems` is replaced
      with `plugins` in the Jekyll config.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7235
      
      Test Plan: `bundle exec jekyll serve`
      
      Reviewed By: pdillinger
      
      Differential Revision: D23034419
      
      Pulled By: ltamasi
      
      fbshipit-source-id: a3f6df1c33281bdfd33aa61c6dc92162d9b7f079
      378bc94d
  2. 12 8月, 2020 4 次提交
    • Y
      Timer should run scheduled function without mutex (#7228) · f15414b6
      Yanqin Jin 提交于
      Summary:
      Timer (defined in timer.h) schedules and runs user-specified fuctions
      regularly. Current implementation holds the mutex while running user
      function, which will lead to contention and waiting.
      To fix, Timer::Run releases mutex before running user function, and
      re-acquires it afterwards.
      This fix will impact how we can cancel a task. If the task is running,
      it is not holding the mutex. The thread calling Cancel() should wait
      until the current task finishes.
      
      Test Plan (devserver):
      make check
      COMPILE_WITH_ASAN=1 make check
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7228
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D23065487
      
      Pulled By: riversand963
      
      fbshipit-source-id: 07cb59741f506d3eb875c8ab90f73437568d3724
      f15414b6
    • Y
      Add CircleCI for tests on non-shm (#7229) · e9daedec
      Yanqin Jin 提交于
      Summary:
      As title.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7229
      
      Test Plan: Watch for CircleCI results.
      
      Reviewed By: siying
      
      Differential Revision: D23023943
      
      Pulled By: riversand963
      
      fbshipit-source-id: 41a989a3ffdfd2decd309185e3b963e810419577
      e9daedec
    • P
      Fix+clean up handling of mock sleeps (#7101) · 6ac1d25f
      Peter Dillinger 提交于
      Summary:
      We have a number of tests hanging on MacOS and windows due to
      mishandling of code for mock sleeps. In addition, the code was in
      terrible shape because the same variable (addon_time_) would sometimes
      refer to microseconds and sometimes to seconds. One test even assumed it
      was nanoseconds but was written to pass anyway.
      
      This has been cleaned up so that DB tests generally use a SpecialEnv
      function to mock sleep, for either some number of microseconds or seconds
      depending on the function called. But to call one of these, the test must first
      call SetMockSleep (precondition enforced with assertion), which also turns
      sleeps in RocksDB into mock sleeps. To also removes accounting for actual
      clock time, call SetTimeElapseOnlySleepOnReopen, which implies
      SetMockSleep (on DB re-open). This latter setting only works by applying
      on DB re-open, otherwise havoc can ensue if Env goes back in time with
      DB open.
      
      More specifics:
      
      Removed some unused test classes, and updated comments on the general
      problem.
      
      Fixed DBSSTTest.GetTotalSstFilesSize using a sync point callback instead
      of mock time. For this we have the only modification to production code,
      inserting a sync point callback in flush_job.cc, which is not a change to
      production behavior.
      
      Removed unnecessary resetting of mock times to 0 in many tests. RocksDB
      deals in relative time. Any behaviors relying on absolute date/time are likely
      a bug. (The above test DBSSTTest.GetTotalSstFilesSize was the only one
      clearly injecting a specific absolute time for actual testing convenience.) Just
      in case I misunderstood some test, I put this note in each replacement:
      // NOTE: Presumed unnecessary and removed: resetting mock time in env
      
      Strengthened some tests like MergeTestTime, MergeCompactionTimeTest, and
      FilterCompactionTimeTest in db_test.cc
      
      stats_history_test and blob_db_test are each their own beast, rather deeply
      dependent on MockTimeEnv. Each gets its own variant of a work-around for
      TimedWait in a mock time environment. (Reduces redundancy and
      inconsistency in stats_history_test.)
      
      Intended follow-up:
      
      Remove TimedWait from the public API of InstrumentedCondVar, and only
      make that accessible through Env by passing in an InstrumentedCondVar and
      a deadline. Then the Env implementations mocking time can fix this problem
      without using sync points. (Test infrastructure using sync points interferes
      with individual tests' control over sync points.)
      
      With that change, we can simplify/consolidate the scattered work-arounds.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7101
      
      Test Plan: make check on Linux and MacOS
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D23032815
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 7f33967ada8b83011fb54e8279365c008bd6610b
      6ac1d25f
    • L
      Remove redundant consistency check from VersionStorageInfo::AddFile (#7237) · a99fb672
      Levi Tamasi 提交于
      Summary:
      `VersionStorageInfo::AddFile` currently has a debug-mode consistency
      check to make sure the newly added file does not overlap with the
      previous one (for levels below L0). Considering that
      `VersionBuilder::CheckConsistency` also performs similar checks (in
      fact, those checks are more comprehensive and cover L0 as well), this
      check is redundant. The patch removes it and also cleans up `AddFile` a
      little.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7237
      
      Test Plan: `make check`
      
      Reviewed By: riversand963
      
      Differential Revision: D23041937
      
      Pulled By: ltamasi
      
      fbshipit-source-id: e00665f3b83bfd17f86c54c238800f3d77d739bd
      a99fb672
  3. 11 8月, 2020 6 次提交
    • A
      Mark files for compaction in stress/crash tests (#7231) · 7eebe6d3
      Andrew Kryczka 提交于
      Summary:
      The mechanism to mark files for compaction is most commonly used in
      delete-triggered compaction. This PR adds an option to exercise the
      marking mechanism on random files created by db_stress. This PR also
      enables that option in db_crashtest.py on its db_stress runs at random.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7231
      
      Test Plan:
      - ran some minified crash tests; verified they succeed and we see `"compaction_reason": "FilesMarkedForCompaction"` regularly in the logs.
      
      ```
      $ TEST_TMPDIR=/dev/shm python tools/db_crashtest.py blackbox --duration=600 --interval=30 --max_key=10000000 --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --value_size_mult=33
      $ TEST_TMPDIR=/dev/shm python tools/db_crashtest.py whitebox --duration=600 --interval=30 --max_key=1000000 --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --value_size_mult=33 --random_kill_odd=8887
      ```
      
      Reviewed By: anand1976
      
      Differential Revision: D23025156
      
      Pulled By: ajkr
      
      fbshipit-source-id: a404c467ebc12afa94dae35956ea9b372f592a96
      7eebe6d3
    • A
      Fix delete triggered compaction for single level universal (#7224) · f308da52
      anand76 提交于
      Summary:
      Delete triggered compaction (DTC) for universal compaction style with ```num_levels = 1``` has been disabled for sometime due to a data correctness bug. This PR re-enables it with a bug fix. A file marked for compaction can be picked, along with all L0 files after it as the compaction input. We stop adding files to the input once we encounter a file already being compacted (the original bug failed to check the compaction status of the files).
      
      Tests:
      Add unit tests to ```compaction_picker_test.cc```
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7224
      
      Reviewed By: ajkr
      
      Differential Revision: D23031845
      
      Pulled By: anand1976
      
      fbshipit-source-id: 9de3cab5f9774cede666c2c48d309a7d9b88a505
      f308da52
    • A
      Allow optimization level to be set in Makefile (#7202) · 6e99de6d
      Andrew Kryczka 提交于
      Summary:
      `-O3` is already adopted widely, so we should make it easier to configure
      for development/open source. This PR adds an `OPTIMIZE_LEVEL` variable
      that users can set to override the `-O` flag chosen in the Makefile.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7202
      
      Test Plan: built a few different ways and verified correct value is passed for `-O` flag
      
      Reviewed By: pdillinger
      
      Differential Revision: D22845291
      
      Pulled By: ajkr
      
      fbshipit-source-id: 84471362e7d627dd606b25bf5f6a3d796817fa1c
      6e99de6d
    • P
      CircleCI: apt retries for downloads from unreliable llvm.org (#7234) · cb26c8cc
      Peter Dillinger 提交于
      Summary:
      Trying to fix issue that caused two failures out of eight most
      recent master builds
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7234
      
      Test Plan: Watch CircleCI
      
      Reviewed By: riversand963
      
      Differential Revision: D23032184
      
      Pulled By: pdillinger
      
      fbshipit-source-id: dae403f63c0e4f6ab8a3e8e49a49069a532b8f4a
      cb26c8cc
    • Y
      Fix cmake build on MacOS (#7205) · 5444942f
      Yuhong Guo 提交于
      Summary:
      1. `std::random_shuffle` is deprecated and now we can use `std::shuffle`
      ```
      /rocksdb/db/prefix_test.cc:590:12: error: 'random_shuffle<std::__1::__wrap_iter<unsigned long long *> >'
            is deprecated [-Werror,-Wdeprecated-declarations]
            std::random_shuffle(prefixes.begin(), prefixes.end());
                 ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:2982:1: note:
            'random_shuffle<std::__1::__wrap_iter<unsigned long long *> >' has been explicitly marked deprecated here
      _LIBCPP_DEPRECATED_IN_CXX14 void
      ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1107:39: note: expanded from macro
            '_LIBCPP_DEPRECATED_IN_CXX14'
      #  define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
                                            ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro
            '_LIBCPP_DEPRECATED'
      #    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
      ```
      2. `c_test` link error with `-DROCKSDB_BUILD_SHARED=OFF`:
      ```
      [  7%] Linking CXX executable c_test
      ld: library not found for -lrocksdb-shared
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[5]: *** [c_test] Error 1
      make[4]: *** [CMakeFiles/c_test.dir/all] Error 2
      make[4]: *** Waiting for unfinished jobs....
      ```
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7205
      
      Reviewed By: ajkr
      
      Differential Revision: D23030641
      
      Pulled By: pdillinger
      
      fbshipit-source-id: f270e50fc0b824ca1a0876ec5c65d33f55a72dd0
      5444942f
    • R
      Fixed typo on Value mismatch error in db_test (#6587) · 633bff2f
      Remington Brasga 提交于
      Summary:
      The debug is supposed to print out two keys to show the value mismatch, which was compared just a few lines above.
      
      However, the actual print-out is the same values (so they obviously won't be mismatched)
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6587
      
      Reviewed By: riversand963
      
      Differential Revision: D23025279
      
      Pulled By: ajkr
      
      fbshipit-source-id: 4c6c35bc60b273f13c08b5464b6f690d8a5cfe41
      633bff2f
  4. 08 8月, 2020 3 次提交
  5. 07 8月, 2020 5 次提交
    • M
      Add more tests to ASSERT_STATUS_CHECKED (#7211) · 56f468b3
      mrambacher 提交于
      Summary:
      Added 4 more tests to those which pass ASSERT_STATUS_CHECKED (cache_test, lru_cache_test, filename_test, filelock_test).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7211
      
      Reviewed By: ajkr
      
      Differential Revision: D22982858
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: acdd071582ed6aa7447ed96c5732f10bf720d783
      56f468b3
    • Y
      Remove duplicate colon in Status message (#7041) · 67bbac36
      Yingchun Lai 提交于
      Summary:
      A colon will be added after 'msg' automatically when invoke function Status(Code _code, const Slice& msg, const Slice& msg2),
      it's not needed to append a colon explicitly to 'msg'.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7041
      
      Reviewed By: ajkr
      
      Differential Revision: D22292801
      
      fbshipit-source-id: 8f2d69065bb779d2613468bf9fc9169f32c3f1ec
      67bbac36
    • J
      fix typo: paraniod -> paranoid (#7163) · 5e1808d5
      jsteemann 提交于
      Summary:
      Rename "paraniod" to "paranoid" in a few places.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7163
      
      Reviewed By: ajkr
      
      Differential Revision: D22678242
      
      fbshipit-source-id: 28b1011a736d0a95612676f7e1b9500a70c324b4
      5e1808d5
    • A
      Automatically number the Maven artifacts (#7219) · 33561876
      Adam Retter 提交于
      Summary:
      Improvements to the RocksJava release process:
      * Generates the Maven artifact version number as part of the release step
      * Also generates appropriate checksum files to speed the deploy and publish step
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7219
      
      Reviewed By: ltamasi
      
      Differential Revision: D22983481
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 7b8ffaf46471cd3cda181eb830c962b317d2e688
      33561876
    • C
      Replace tracked_keys with a new LockTracker interface in TransactionDB (#7013) · 71c7e493
      Cheng Chang 提交于
      Summary:
      We're going to support more locking protocols such as range lock in transaction.
      
      However, in current design, `TransactionBase` has a member `tracked_keys` which assumes that point lock (lock a single key) is used, and is used in snapshot checking (isolation protocol). When using range lock, we may use read committed instead of snapshot checking as the isolation protocol.
      
      The most significant usage scenarios of `tracked_keys` are:
      1. pessimistic transaction uses it to track the locked keys, and unlock these keys when commit or rollback.
      2. optimistic transaction does not lock keys upfront, it only tracks the lock intentions in tracked_keys, and do write conflict checking when commit.
      3. each `SavePoint` tracks the keys that are locked since the `SavePoint`, `RollbackToSavePoint` or `PopSavePoint` relies on both the tracked keys in `SavePoint`s and `tracked_keys`.
      
      Based on these scenarios, if we can abstract out a `LockTracker` interface to hold a set of tracked locks (can be keys or key ranges), and have methods that can be composed together to implement the scenarios, then `tracked_keys` can be an internal data structure of one implementation of `LockTracker`. See `utilities/transactions/lock/lock_tracker.h` for the detailed interface design, and `utilities/transactions/lock/point_lock_tracker.cc` for the implementation.
      
      In the future, a `RangeLockTracker` can be implemented to track range locks without affecting other components.
      
      After this PR, a clean interface for lock manager should be possible, and then ideally, we can have pluggable locking protocols.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7013
      
      Test Plan: Run `transaction_test` and `optimistic_transaction_test`.
      
      Reviewed By: ajkr
      
      Differential Revision: D22163706
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: f2860577b5334e31dd2994f5bc6d7c40d502b1b4
      71c7e493
  6. 06 8月, 2020 3 次提交
    • C
      Define WAL related classes to be used in VersionEdit and VersionSet (#7164) · cd48ecaa
      Cheng Chang 提交于
      Summary:
      `WalAddition`, `WalDeletion` are defined in `wal_version.h` and used in `VersionEdit`.
      `WalAddition` is used to represent events of creating a new WAL (no size, just log number), or closing a WAL (with size).
      `WalDeletion` is used to represent events of deleting or archiving a WAL, it means the WAL is no longer alive (won't be replayed during recovery).
      
      `WalSet` is the set of alive WALs kept in `VersionSet`.
      
      1. Why use `WalDeletion` instead of relying on `MinLogNumber` to identify outdated WALs
      
      On recovery, we can compute `MinLogNumber()` based on the log numbers kept in MANIFEST, any log with number < MinLogNumber can be ignored. So it seems that we don't need to persist `WalDeletion` to MANIFEST, since we can ignore the WALs based on MinLogNumber.
      
      But the `MinLogNumber()` is actually a lower bound, it does not exactly mean that logs starting from MinLogNumber must exist. This is because in a corner case, when a column family is empty and never flushed, its log number is set to the largest log number, but not persisted in MANIFEST. So let's say there are 2 column families, when creating the DB, the first WAL has log number 1, so it's persisted to MANIFEST for both column families. Then CF 0 is empty and never flushed, CF 1 is updated and flushed, so a new WAL with log number 2 is created and persisted to MANIFEST for CF 1. But CF 0's log number in MANIFEST is still 1. So on recovery, MinLogNumber is 1, but since log 1 only contains data for CF 1, and CF 1 is flushed, log 1 might have already been deleted from disk.
      
      We can make `MinLogNumber()` be the exactly minimum log number that must exist, by persisting the most recent log number for empty column families that are not flushed. But if there are N such column families, then every time a new WAL is created, we need to add N records to MANIFEST.
      
      In current design, a record is persisted to MANIFEST only when WAL is created, closed, or deleted/archived, so the number of WAL related records are bounded to 3x number of WALs.
      
      2. Why keep `WalSet` in `VersionSet` instead of applying the `VersionEdit`s to `VersionStorageInfo`
      
      `VersionEdit`s are originally designed to track the addition and deletion of SST files. The SST files are related to column families, each column family has a list of `Version`s, and each `Version` keeps the set of active SST files in `VersionStorageInfo`.
      
      But WALs are a concept of DB, they are not bounded to specific column families. So logically it does not make sense to store WALs in a column family's `Version`s.
      Also, `Version`'s purpose is to keep reference to SST / blob files, so that they are not deleted until there is no version referencing them. But a WAL is deleted regardless of version references.
      So we keep the WALs in `VersionSet`  for the purpose of writing out the DB state's snapshot when creating new MANIFESTs.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7164
      
      Test Plan:
      make version_edit_test && ./version_edit_test
      make wal_edit_test && ./wal_edit_test
      
      Reviewed By: ltamasi
      
      Differential Revision: D22677936
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: 5a3b6890140e572ffd79eb37e6e4c3c32361a859
      cd48ecaa
    • L
      Remove assertion from FaultInjectionTestFS::NewDirectory (#7220) · 124fbd96
      Levi Tamasi 提交于
      Summary:
      FaultInjectionTestFS::NewDirectory currently asserts that the directory
      creation on the target filesystem succeeds. This is actually not
      guaranteed since there might be a legitimate I/O error when creating the
      directory. The patch removes this assertion.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7220
      
      Test Plan: `make check`
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D22957990
      
      Pulled By: ltamasi
      
      fbshipit-source-id: b2e221320d8ce7235cb4897ef5936072412a25b6
      124fbd96
    • S
      Clean up InternalIterator upper bound logic a little bit (#7200) · 5c1a5441
      sdong 提交于
      Summary:
      IteratorIterator::IsOutOfBound() and IteratorIterator::MayBeOutOfUpperBound() are two functions that related to upper bound check. It is hard for users to reason about this complexity. Consolidate the two functions into one and assign an enum as results to improve readability.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7200
      
      Test Plan: Run all existing test. Would run crash test with atomic for a while.
      
      Reviewed By: anand1976
      
      Differential Revision: D22833181
      
      fbshipit-source-id: a0c724267056adbd0476bde74650e6c7226077e6
      5c1a5441
  7. 05 8月, 2020 4 次提交
    • Y
      ReadOptions.iter_start_ts should support tombstones (#7178) · 2735b027
      Yanqin Jin 提交于
      Summary:
      as title.
      When ReadOptions.iter_start_ts is not nullptr, DBIter::key() should
      return internal keys including value type.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7178
      
      Test Plan: make check
      
      Reviewed By: ltamasi
      
      Differential Revision: D22935879
      
      Pulled By: riversand963
      
      fbshipit-source-id: 7508d962cf11ebcfa6386d2529b4f3606b47ccfd
      2735b027
    • A
      Add support to start and end IOTracing through DB APIs (#7203) · 493f425e
      Akanksha Mahajan 提交于
      Summary:
      1. Add support to start io tracing through DB::StartIOTrace(Env*, const TraceOptions&, std::unique_ptr<TraceWriter>&&) and end tracing through DB::EndIOTrace(). This doesn't trace DB::Open.
      
      User side code:
      
      //Open DB
      DB::Open(options, dbname, &db);
      
      /* Start tracing */
      db->StartIOTrace(env, trace_opt, std::move(trace_writer));
      
      /* Perform Operations */
      
      /*End tracing*/
      db->EndIOTrace();
      
      2. Fix the build errors for Windows.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7203
      
      Test Plan: make check -j64
      
      Reviewed By: anand1976
      
      Differential Revision: D22901947
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: e59c0b785a802168e6f1aa028d99c224a35cb30c
      493f425e
    • S
      Fix a perf regression that caused every key to go through upper bound check (#7209) · 41c328fe
      sdong 提交于
      Summary:
      https://github.com/facebook/rocksdb/pull/5289 introduces a performance regression that caused an upper bound check within every BlockBasedTableIterator::Next(). This is unnecessary if we've checked the boundary key for current block and it is within upper bound.
      
      Fix the bug. Also rename the boolean to a enum so that the code is slightly better readable. The original regression was probably to fix a bug that the block upper bound check status is not reset after a new block is created. Fix it bug so that the regression can be avoided without hitting the bug.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7209
      
      Test Plan: Run all existing tests. Will run atomic black box crash test for a while.
      
      Reviewed By: anand1976
      
      Differential Revision: D22859246
      
      fbshipit-source-id: cbdad1f5e656c55fd8b71726d5a4f6cb53ff9140
      41c328fe
    • J
      Fix Timer unable to schedule new added job (#7216) · fea286d9
      Jay Zhuang 提交于
      Summary:
      And added test to reproduce the problem.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7216
      
      Reviewed By: riversand963
      
      Differential Revision: D22905193
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 8ca1435c91bf829f9076c743bdd66861364ff68c
      fea286d9
  8. 04 8月, 2020 4 次提交
    • L
      Move CompressionType to its own header file (#7162) · 8cb278d1
      Levi Tamasi 提交于
      Summary:
      The patch moves `CompressionType` to its own header file and makes sure
      all other public headers include this new header directly, as opposed to
      relying on transitive includes or forward declarations.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7162
      
      Test Plan: `make check`
      
      Reviewed By: riversand963
      
      Differential Revision: D22676545
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 01d7a232377a229cbbc373d0ec1bf01dc0b0ce02
      8cb278d1
    • A
      dedup ReadOptions in iterator hierarchy (#7210) · a4a4a2da
      Andrew Kryczka 提交于
      Summary:
      Previously, a `ReadOptions` object was stored in every `BlockBasedTableIterator`
      and every `LevelIterator`. This redundancy consumes extra memory,
      resulting in the `Arena` making more allocations, and iteration
      observing worse cache performance.
      
      This PR migrates callers of `NewInternalIterator()` and
      `MakeInputIterator()` to provide a `ReadOptions` object guaranteed to
      outlive the returned iterator. When the iterator's lifetime will be managed by the
      user, this lifetime guarantee is achieved by storing the `ReadOptions`
      value in `ArenaWrappedDBIter`. Then, sub-iterators of `NewInternalIterator()` and
      `MakeInputIterator()` can hold a reference-to-const `ReadOptions`.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7210
      
      Test Plan:
      - `make check` under ASAN and valgrind
      - benchmark: on a DB with 2 L0 files and 3 L1+ levels, this PR reduced `Arena` allocation 4792 -> 4160 bytes.
      
      Reviewed By: anand1976
      
      Differential Revision: D22861323
      
      Pulled By: ajkr
      
      fbshipit-source-id: 54aebb3e89c872eeab0f5793b4b6e42878d093ce
      a4a4a2da
    • A
      Add defaults to ReadOptions doc (#7215) · 18efd760
      Adam Retter 提交于
      Summary:
      Very small improvements to document the defaults.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7215
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D22902286
      
      fbshipit-source-id: a754d172a0d8e4c03754f6f1771d4a693d60a770
      18efd760
    • J
      Fix hang timer tests on macos (#7208) · d941b89d
      Jay Zhuang 提交于
      Summary:
      And re-enable disabled tests.
      The issue is caused by `CondVar.TimedWait()` doesn't use `MockTimeEnv`.
      
      Issue: https://github.com/facebook/rocksdb/issues/6698
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7208
      
      Test Plan: `./timer_test --gtest_repeat=1000`
      
      Reviewed By: riversand963
      
      Differential Revision: D22857855
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 6d15f65f6ae58b75b76cb132815c16ad81ffd12f
      d941b89d
  9. 30 7月, 2020 4 次提交
    • A
      Compaction Read/Write Stats by Compaction Type (#7165) · 56ed601d
      Aaron Kabcenell 提交于
      Summary:
      Adds compaction statistics (total bytes read and written) for compactions that occur for delete-triggered, periodic, and TTL compaction reasons.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7165
      
      Test Plan:
      TTL and periodic can be checked by runnning db_bench with the options activated:
      
      /db_bench --benchmarks="fillrandom,stats" --statistics --num=10000000 -base_background_compactions=16 -periodic_compaction_seconds=1
      ./db_bench --benchmarks="fillrandom,stats" --statistics --num=10000000 -base_background_compactions=16 -fifo_compaction_ttl=1
      
      Setting the time to one second causes non-zero bytes read/written for those compaction reasons. Disabling them or setting them to times longer than the test run length causes the stats to return to zero as expected.
      
      Delete-triggered compaction counting is tested in DBTablePropertiesTest.DeletionTriggeredCompactionMarking
      
      Reviewed By: ajkr
      
      Differential Revision: D22693050
      
      Pulled By: akabcenell
      
      fbshipit-source-id: d15cef4d94576f703015c8942d5f0d492f69401d
      56ed601d
    • C
      feat: export SetBackgroundThreads(n, Env::BOTTOM); (#7191) · 50f206ad
      codingsh 提交于
      Summary:
      - https://github.com/rust-rocksdb/rust-rocksdb/pull/448
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7191
      
      Reviewed By: riversand963
      
      Differential Revision: D22809066
      
      Pulled By: ajkr
      
      fbshipit-source-id: 036939f9a28cacc3f677c318d1aed97fe5f4f85e
      50f206ad
    • Y
      Update HISTORY and version for 6.12 release (#7194) · a38f04ac
      Yanqin Jin 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/7194
      
      Reviewed By: gg814
      
      Differential Revision: D22810654
      
      Pulled By: riversand963
      
      fbshipit-source-id: 01f13089fa2b7e31b827da3e30c90e5c62c41380
      a38f04ac
    • S
      Implement NextAndGetResult() in memtable and level iterator (#7179) · 692f6a31
      sdong 提交于
      Summary:
      NextAndGetResult() is not implemented in memtable and is very simply implemented in level iterator. The result is that for a normal leveled iterator, performance regression will be observed for calling PrepareValue() for most iterator Next(). Mitigate the problem by implementing the function for both iterators. In level iterator, the implementation cannot be perfect as when calling file iterator's SeekToFirst() we don't have information about whether the value is prepared. Fortunately, the first key should not cause a big portion of the CPu.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7179
      
      Test Plan: Run normal crash test for a while.
      
      Reviewed By: anand1976
      
      Differential Revision: D22783840
      
      fbshipit-source-id: c19f45cdf21b756190adef97a3b66ccde3936e05
      692f6a31