1. 01 12月, 2021 2 次提交
  2. 20 11月, 2021 2 次提交
    • P
      Print failures in parallel `make check` (#9188) · 3ce4d4f5
      Peter Dillinger 提交于
      Summary:
      Generating megabytes of successful test output has caused
      issues / inconveniences for CI and internal sandcastle runs. This
      changes their configuration to only print output from failed tests.
      (Successful test output is still available in files under t/.)
      
      This likewise changes default behavior of parallel `make check` as
      a quick team poll showed interest in that.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/9188
      
      Test Plan:
      Seed some test failures and observe
      * `make -j24 check` (new behavior)
      * `PRINT_PARALLEL_OUTPUTS=1 make -j24 check` (old CI behavior)
      * `QUIET_PARALLEL_TESTS=1 make -j24 check` (old manual run behavior)
      
      Reviewed By: siying
      
      Differential Revision: D32567392
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 8d8fb64aebd16bca103b11e3bd1f13c488a69611
      3ce4d4f5
    • A
      Some small changes to RocksJava build (#9186) · ad40b0be
      Adam Retter 提交于
      Summary:
      1. Added a target for building a bundle jar for Sonatype Nexus - sometimes if the OSS Maven Central is misbehaving, it is quicker to upload a bundle to be processed for release.
      
      2. Simplify the publish code by using a for-loop.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/9186
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D32564469
      
      Pulled By: ajkr
      
      fbshipit-source-id: aaceac27e9143fb65b61dad2a46df346586672cd
      ad40b0be
  3. 19 11月, 2021 1 次提交
    • P
      Improve / clean up meta block code & integrity (#9163) · 230660be
      Peter Dillinger 提交于
      Summary:
      * Checksums are now checked on meta blocks unless specifically
      suppressed or not applicable (e.g. plain table). (Was other way around.)
      This means a number of cases that were not checking checksums now are,
      including direct read TableProperties in Version::GetTableProperties
      (fixed in meta_blocks ReadTableProperties), reading any block from
      PersistentCache (fixed in BlockFetcher), read TableProperties in
      SstFileDumper (ldb/sst_dump/BackupEngine) before table reader open,
      maybe more.
      * For that to work, I moved the global_seqno+TableProperties checksum
      logic to the shared table/ code, because that is used by many utilies
      such as SstFileDumper.
      * Also for that to work, we have to know when we're dealing with a block
      that has a checksum (trailer), so added that capability to Footer based
      on magic number, and from there BlockFetcher.
      * Knowledge of trailer presence has also fixed a problem where other
      table formats were reading blocks including bytes for a non-existant
      trailer--and awkwardly kind-of not using them, e.g. no shared code
      checking checksums. (BlockFetcher compression type was populated
      incorrectly.) Now we only read what is needed.
      * Minimized code duplication and differing/incompatible/awkward
      abstractions in meta_blocks.{cc,h} (e.g. SeekTo in metaindex block
      without parsing block handle)
      * Moved some meta block handling code from table_properties*.*
      * Moved some code specific to block-based table from shared table/ code
      to BlockBasedTable class. The checksum stuff means we can't completely
      separate it, but things that don't need to be in shared table/ code
      should not be.
      * Use unique_ptr rather than raw ptr in more places. (Note: you can
      std::move from unique_ptr to shared_ptr.)
      
      Without enhancements to GetPropertiesOfAllTablesTest (see below),
      net reduction of roughly 100 lines of code.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/9163
      
      Test Plan:
      existing tests and
      * Enhanced DBTablePropertiesTest.GetPropertiesOfAllTablesTest to verify that
      checksums are now checked on direct read of table properties by TableCache
      (new test would fail before this change)
      * Also enhanced DBTablePropertiesTest.GetPropertiesOfAllTablesTest to test
      putting table properties under old meta name
      * Also generally enhanced that same test to actually test what it was
      supposed to be testing already, by kicking things out of table cache when
      we don't want them there.
      
      Reviewed By: ajkr, mrambacher
      
      Differential Revision: D32514757
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 507964b9311d186ae8d1131182290cbd97a99fa9
      230660be
  4. 18 11月, 2021 1 次提交
  5. 17 11月, 2021 2 次提交
  6. 07 11月, 2021 1 次提交
  7. 04 11月, 2021 1 次提交
    • J
      Skip directory fsync for filesystem btrfs (#8903) · 29102641
      Jay Zhuang 提交于
      Summary:
      Directory fsync might be expensive on btrfs and it may not be needed.
      Here are 4 directory fsync cases:
      1. creating a new file: dir-fsync is not needed on btrfs, as long as the
         new file itself is synced.
      2. renaming a file: dir-fsync is not needed if the renamed file is
         synced. So an API `FsyncAfterFileRename(filename, ...)` is provided
         to sync the file on btrfs. By default, it just calls dir-fsync.
      3. deleting files: dir-fsync is forced by set
         `IOOptions.force_dir_fsync = true`
      4. renaming multiple files (like backup and checkpoint): dir-fsync is
         forced, the same as above.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8903
      
      Test Plan: run tests on btrfs and non btrfs
      
      Reviewed By: ajkr
      
      Differential Revision: D30885059
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: dd2730b31580b0bcaedffc318a762d7dbf25de4a
      29102641
  8. 29 10月, 2021 1 次提交
  9. 23 10月, 2021 1 次提交
  10. 06 10月, 2021 1 次提交
  11. 11 9月, 2021 1 次提交
    • P
      Fix and detect headers with missing dependencies (#8893) · bda8d93b
      Peter Dillinger 提交于
      Summary:
      It's always annoying to find a header does not include its own
      dependencies and only works when included after other includes. This
      change adds `make check-headers` which validates that each header can
      be included at the top of a file. Some headers are excluded e.g. because
      of platform or external dependencies.
      
      rocksdb_namespace.h had to be re-worked slightly to enable checking for
      failure to include it. (ROCKSDB_NAMESPACE is a valid namespace name.)
      
      Fixes mostly involve adding and cleaning up #includes, but for
      FileTraceWriter, a constructor was out-of-lined to make a forward
      declaration sufficient.
      
      This check is not currently run with `make check` but is added to
      CircleCI build-linux-unity since that one is already relatively fast.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8893
      
      Test Plan: existing tests and resolving issues detected by new check
      
      Reviewed By: mrambacher
      
      Differential Revision: D30823300
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 9fff223944994c83c105e2e6496d24845dc8e572
      bda8d93b
  12. 08 9月, 2021 1 次提交
    • P
      Add (& fix) some simple source code checks (#8821) · cb5b851f
      Peter Dillinger 提交于
      Summary:
      * Don't hardcode namespace rocksdb (use ROCKSDB_NAMESPACE)
      * Don't #include <rocksdb/...> (use double quotes)
      * Support putting NOCOMMIT (any case) in source code that should not be
      committed/pushed in current state.
      
      These will be run with `make check` and in GitHub actions
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8821
      
      Test Plan: existing tests, manually try out new checks
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30791726
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 399c883f312be24d9e55c58951d4013e18429d92
      cb5b851f
  13. 25 8月, 2021 1 次提交
    • H
      Refactor WriteBufferManager::CacheRep into CacheReservationManager (#8506) · 74cfe7db
      Hui Xiao 提交于
      Summary:
      Context:
      To help cap various memory usage by a single limit of the block cache capacity, we charge the memory usage through inserting/releasing dummy entries in the block cache. CacheReservationManager is such a class (non thread-safe) responsible for  inserting/removing dummy entries to reserve cache space for memory used by the class user.
      
      - Refactored the inner private class CacheRep of WriteBufferManager into public CacheReservationManager class for reusability such as for https://github.com/facebook/rocksdb/pull/8428
      
      - Encapsulated implementation details of cache key generation and dummy entries insertion/release in cache reservation as discussed in https://github.com/facebook/rocksdb/pull/8506#discussion_r666550838
      
      - Consolidated increase/decrease cache reservation into one API - UpdateCacheReservation.
      
      - Adjusted the previous dummy entry release algorithm in decreasing cache reservation to be loop-releasing dummy entries to stay symmetric to dummy entry insertion algorithm
      
      - Made the previous dummy entry release algorithm in delayed decrease mode more aggressive for better decreasing cache reservation when memory used is less likely to increase back.
      
        Previously, the algorithms only release 1 dummy entries when new_mem_used < 3/4 * cache_allocated_size_ and cache_allocated_size_ - kSizeDummyEntry > new_mem_used.
      Now, the algorithms loop-releases as many dummy entries as possible when new_mem_used < 3/4 * cache_allocated_size_.
      
      - Updated WriteBufferManager's test cases to adapt to changes on the release algorithm mentioned above and left comment for some test cases for clarity
      
      - Replaced the previous cache key prefix generation (utilizing object address related to the cache client) with one that utilizes Cache->NewID() to prevent cache-key collision among dummy entry clients sharing the same cache.
      
        The specific collision we are preventing happens when the object address is reused for a new cache-key prefix while the old cache-key using that same object address in its prefix still exists in the cache. This could happen due to that, under LRU cache policy, there is a possible delay in releasing a cache entry after the cache client object owning that cache entry get deallocated. In this case, the object address related to the cache client object can get reused for other client object to generate a new cache-key prefix.
      
        This prefix generation can be made obsolete after Peter's unification of all the code generating cache key, mentioned in https://github.com/facebook/rocksdb/pull/8506#discussion_r667265255
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8506
      
      Test Plan:
      - Passing the added unit tests cache_reservation_manager_test.cc
      - Passing existing and adjusted write_buffer_manager_test.cc
      
      Reviewed By: ajkr
      
      Differential Revision: D29644135
      
      Pulled By: hx235
      
      fbshipit-source-id: 0fc93fbfe4a40bb41be85c314f8f2bafa8b741f7
      74cfe7db
  14. 16 8月, 2021 1 次提交
  15. 17 7月, 2021 1 次提交
  16. 13 7月, 2021 1 次提交
    • P
      Improve support for valgrind error on reachable (#8503) · a53d6d25
      Peter Dillinger 提交于
      Summary:
      MyRocks apparently uses valgrind to check for unreachable
      unfreed data, which is stricter than our valgrind checks. Internal ref:
      D29257815
      
      This patch adds valgrind support to STATIC_AVOID_DESTRUCTION so that it's
      not reported with those stricter checks.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8503
      
      Test Plan:
      make valgrind_test
      Also, with modified VALGRIND_OPTS (see Makefile), more kinds of
      failures seen before than after this commit.
      
      Reviewed By: ajkr, yizhang82
      
      Differential Revision: D29597784
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 360de157a176aec4d1be99ca20d160ecd47c0873
      a53d6d25
  17. 09 7月, 2021 1 次提交
    • J
      Add micro-benchmark support (#8493) · 5dd18a8d
      Jay Zhuang 提交于
      Summary:
      Add google benchmark for microbench.
      Add ribbon_bench for benchmark ribbon filter vs. other filters.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8493
      
      Test Plan:
      added test to CI
      To run the benchmark on devhost:
      Install benchmark: `$ sudo dnf install google-benchmark-devel`
      Build and run:
      `$ ROCKSDB_NO_FBCODE=1 DEBUG_LEVEL=0 make microbench`
      or with cmake:
      `$ mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_BENCHMARK=1 && make microbench`
      
      Reviewed By: pdillinger
      
      Differential Revision: D29589649
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 8fed13b562bef4472f161ecacec1ab6b18911dff
      5dd18a8d
  18. 08 7月, 2021 1 次提交
  19. 24 6月, 2021 1 次提交
  20. 22 6月, 2021 2 次提交
    • L
      Add a class for measuring the amount of garbage generated during compaction (#8426) · 065bea15
      Levi Tamasi 提交于
      Summary:
      This is part of an alternative approach to https://github.com/facebook/rocksdb/issues/8316.
      Unlike that approach, this one relies on key-values getting processed one by one
      during compaction, and does not involve persistence.
      
      Specifically, the patch adds a class `BlobGarbageMeter` that can track the number
      and total size of blobs in a (sub)compaction's input and output on a per-blob file
      basis. This information can then be used to compute the amount of additional
      garbage generated by the compaction for any given blob file by subtracting the
      "outflow" from the "inflow."
      
      Note: this patch only adds `BlobGarbageMeter` and associated unit tests. I plan to
      hook up this class to the input and output of `CompactionIterator` in a subsequent PR.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8426
      
      Test Plan: `make check`
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29242250
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 597e50ad556540e413a50e804ba15bc044d809bb
      065bea15
    • A
      Skip c_test and env_test when ASSERT_STATUS_CHECKED=1 (#8430) · 6f339018
      Andrew Kryczka 提交于
      Summary:
      - `c_test` fails because `rocksdb_compact_range()` swallows a `Status`.
      - `env_test` fails because `ReadRequest`s to `MultiRead()` do not have their `Status`es checked.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8430
      
      Test Plan: `ASSERT_STATUS_CHECKED=1 make -j48 check`
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29257473
      
      Pulled By: ajkr
      
      fbshipit-source-id: e02127f971703744be7de85f0a028e4664c79577
      6f339018
  21. 10 6月, 2021 1 次提交
    • L
      Add a clipping internal iterator (#8327) · db325a59
      Levi Tamasi 提交于
      Summary:
      Logically, subcompactions process a key range [start, end); however, the way
      this is currently implemented is that the `CompactionIterator` for any given
      subcompaction keeps processing key-values until it actually outputs a key that
      is out of range, which is then discarded. Instead of doing this, the patch
      introduces a new type of internal iterator called `ClippingIterator` which wraps
      another internal iterator and "clips" its range of key-values so that any KVs
      returned are strictly in the [start, end) interval. This does eliminate a (minor)
      inefficiency by stopping processing in subcompactions exactly at the limit;
      however, the main motivation is related to BlobDB: namely, we need this to be
      able to measure the amount of garbage generated by a subcompaction
      precisely and prevent off-by-one errors.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8327
      
      Test Plan: `make check`
      
      Reviewed By: siying
      
      Differential Revision: D28761541
      
      Pulled By: ltamasi
      
      fbshipit-source-id: ee0e7229f04edabbc7bed5adb51771fbdc287f69
      db325a59
  22. 20 5月, 2021 2 次提交
  23. 22 4月, 2021 1 次提交
    • A
      Stall writes in WriteBufferManager when memory_usage exceeds buffer_size (#7898) · 596e9008
      Akanksha Mahajan 提交于
      Summary:
      When WriteBufferManager is shared across DBs and column families
      to maintain memory usage under a limit, OOMs have been observed when flush cannot
      finish but writes continuously insert to memtables.
      In order to avoid OOMs, when memory usage goes beyond buffer_limit_ and DBs tries to write,
      this change will stall incoming writers until flush is completed and memory_usage
      drops.
      
      Design: Stall condition: When total memory usage exceeds WriteBufferManager::buffer_size_
      (memory_usage() >= buffer_size_) WriterBufferManager::ShouldStall() returns true.
      
      DBImpl first block incoming/future writers by calling write_thread_.BeginWriteStall()
      (which adds dummy stall object to the writer's queue).
      Then DB is blocked on a state State::Blocked (current write doesn't go
      through). WBStallInterface object maintained by every DB instance is added to the queue of
      WriteBufferManager.
      
      If multiple DBs tries to write during this stall, they will also be
      blocked when check WriteBufferManager::ShouldStall() returns true.
      
      End Stall condition: When flush is finished and memory usage goes down, stall will end only if memory
      waiting to be flushed is less than buffer_size/2. This lower limit will give time for flush
      to complete and avoid continous stalling if memory usage remains close to buffer_size.
      
      WriterBufferManager::EndWriteStall() is called,
      which removes all instances from its queue and signal them to continue.
      Their state is changed to State::Running and they are unblocked. DBImpl
      then signal all incoming writers of that DB to continue by calling
      write_thread_.EndWriteStall() (which removes dummy stall object from the
      queue).
      
      DB instance creates WBMStallInterface which is an interface to block and
      signal DBs during stall.
      When DB needs to be blocked or signalled by WriteBufferManager,
      state_for_wbm_ state is changed accordingly (RUNNING or BLOCKED).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7898
      
      Test Plan: Added a new test db/db_write_buffer_manager_test.cc
      
      Reviewed By: anand1976
      
      Differential Revision: D26093227
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 2bbd982a3fb7033f6de6153aa92a221249861aae
      596e9008
  24. 16 4月, 2021 1 次提交
  25. 07 4月, 2021 1 次提交
  26. 05 4月, 2021 1 次提交
    • P
      Make tests "parallel" and "passing ASC" by default (#8146) · bd7ddf58
      Peter Dillinger 提交于
      Summary:
      New tests should by default be expected to be parallelizeable
      and passing with ASSERT_STATUS_CHECKED. Thus, I'm changing those two
      lists to exclusions rather than inclusions.
      
      For the set of exclusions, I only listed things that currently failed
      for me when attempting not to exclude, or had some other documented
      reason. This marks many more tests as "parallel," which will potentially
      cause some failures from self-interference, but we can address those as
      they are discovered.
      
      Also changed CircleCI ASC test to be parallelized; the easy way to do
      that is to exclude building tests that don't pass ASC, which is now a
      small set.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8146
      
      Test Plan: Watch CI, etc.
      
      Reviewed By: riversand963
      
      Differential Revision: D27542782
      
      Pulled By: pdillinger
      
      fbshipit-source-id: bdd74bcd912a963ee33f3fc0d2cad2567dc7740f
      bd7ddf58
  27. 31 3月, 2021 1 次提交
    • M
      Pass PLATFORM_FLAGS in build_detect_platform (#8111) · 493a4e28
      mrambacher 提交于
      Summary:
      At least under MacOS, some things were excluded from the build (like Snappy) because the compilation flags were not passed in correctly.  This PR does a few things:
      - Passes the EXTRA_CXX/LDFLAGS into build_detect_platform.  This means that if some tool (like TBB for example) is not installed in a standard place, it could still be detected by build_detect_platform.  In this case, the developer would invoke: "EXTRA_CXXFLAGS=<path to TBB include> EXTRA_LDFLAGS=<path to TBB library> make", and the build script would find the tools in the extra location.
      - Changes the compilation tests to use PLATFORM_CXXFLAGS.  This change causes the EXTRA_FLAGS passed in to the script to be included in the compilation check.  Additionally, flags set by the script itself (like --std=c++11) will be used during the checks.
      
      Validated that the make_platform.mk file generated on Linux does not change with this change.  On my MacOS machine, the SNAPPY libraries are now available (they were not before as they required --std=c++11 to build).
      
      I also verified that I can build against TBB installed on my Mac by passing in the EXTRA CXX and LD FLAGS to the location in which TBB is installed.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8111
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D27353516
      
      Pulled By: mrambacher
      
      fbshipit-source-id: b6b378c96dbf678bab1479556dcbcb49c47e807d
      493a4e28
  28. 30 3月, 2021 1 次提交
  29. 29 3月, 2021 1 次提交
    • M
      Fix make tags to not rebuild all the object files (#8097) · 5841bbe3
      mrambacher 提交于
      Summary:
      Because build_version.cc is dependent on the library objects (to force a re-generation of it), the library objects would be built in order to satisfy this rule.  Because there is a build_version.d file, it would need generated and included.
      
      Change the ALL_DEPS/FILES to not include build_version.cc (meaning no .d file for it, which is okay since it is generated).  Also changed the rule on whether or not to generate DEP files to skip tags.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8097
      
      Reviewed By: ajkr
      
      Differential Revision: D27299815
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 1efbe8a56d062f57ae13b6c2944ad3faf775087e
      5841bbe3
  30. 23 3月, 2021 1 次提交
    • Y
      Add user-defined timestamps to db_stress (#8061) · 08144bc2
      Yanqin Jin 提交于
      Summary:
      Add some basic test for user-defined timestamp to db_stress. Currently,
      read with timestamp always tries to read using the current timestamp.
      Due to the per-key timestamp-sequence ordering constraint, we only add timestamp-
      related tests to the `NonBatchedOpsStressTest` since this test serializes accesses
      to the same key and uses a file to cross-check data correctness.
      The timestamp feature is not supported in a number of components, e.g. Merge, SingleDelete,
      DeleteRange, CompactionFilter, Readonly instance, secondary instance, SST file ingestion, transaction,
      etc. Therefore, db_stress should exit if user enables both timestamp and these features at the same
      time. The (currently) incompatible features can be found in
      `CheckAndSetOptionsForUserTimestamp`.
      
      This PR also fixes a bug triggered when timestamp is enabled together with
      `index_type=kBinarySearchWithFirstKey`. This bug fix will also be in another separate PR
      with more unit tests coverage. Fixing it here because I do not want to exclude the index type
      from crash test.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8061
      
      Test Plan: make crash_test_with_ts
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D27056282
      
      Pulled By: riversand963
      
      fbshipit-source-id: c3e00ad1023fdb9ebbdf9601ec18270c5e2925a9
      08144bc2
  31. 19 3月, 2021 1 次提交
  32. 16 3月, 2021 1 次提交
  33. 10 3月, 2021 1 次提交
  34. 26 2月, 2021 1 次提交
    • Y
      Compaction filter support for (new) BlobDB (#7974) · cef4a6c4
      Yanqin Jin 提交于
      Summary:
      Allow applications to implement a custom compaction filter and pass it to BlobDB.
      
      The compaction filter's custom logic can operate on blobs.
      To do so, application needs to subclass `CompactionFilter` abstract class and implement `FilterV2()` method.
      Optionally, a method called `ShouldFilterBlobByKey()` can be implemented if application's custom logic rely solely
      on the key to make a decision without reading the blob, thus saving extra IO. Examples can be found in
      db/blob/db_blob_compaction_test.cc.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7974
      
      Test Plan: make check
      
      Reviewed By: ltamasi
      
      Differential Revision: D26509280
      
      Pulled By: riversand963
      
      fbshipit-source-id: 59f9ae5614c4359de32f4f2b16684193cc537b39
      cef4a6c4
  35. 23 2月, 2021 1 次提交