1. 17 2月, 2021 2 次提交
  2. 16 2月, 2021 1 次提交
  3. 12 2月, 2021 1 次提交
  4. 11 2月, 2021 6 次提交
    • Z
      Handoff checksum Implementation (#7523) · d1c510ba
      Zhichao Cao 提交于
      Summary:
      in PR https://github.com/facebook/rocksdb/issues/7419 , we introduce the new Append and PositionedAppend APIs to WritableFile at File System, which enable RocksDB to pass the data verification information (e.g., checksum of the data) to the lower layer. In this PR, we use the new API in WritableFileWriter, such that the file created via WritableFileWrite can pass the checksum to the storage layer. To control which types file should apply the checksum handoff, we add checksum_handoff_file_types to DBOptions. User can use this option to control which file types (Currently supported file tyes: kLogFile, kTableFile, kDescriptorFile.) should use the new Append and PositionedAppend APIs to handoff the verification information.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7523
      
      Test Plan: add new unit test, pass make check/ make asan_check
      
      Reviewed By: pdillinger
      
      Differential Revision: D24313271
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: aafd69091ae85c3318e3e17cbb96fe7338da11d0
      d1c510ba
    • P
      Add prefetching (batched MultiGet) for experimental Ribbon filter (#7889) · e4f1e64c
      Peter Dillinger 提交于
      Summary:
      Adds support for prefetching data in Ribbon queries,
      which especially optimizes batched Ribbon queries for MultiGet
      (~222ns/key to ~97ns/key) but also single key queries on cold memory
      (~333ns to ~226ns) because many queries span more than one cache line.
      
      This required some refactoring of the query algorithm, and there
      does not appear to be a noticeable regression in "hot memory" query
      times (perhaps from 48ns to 50ns).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7889
      
      Test Plan:
      existing unit tests, plus performance validation with
      filter_bench:
      
      Each data point is the best of two runs. I saturated the machine
      CPUs with other filter_bench runs in the background.
      
      Before:
      
          $ ./filter_bench -impl=3 -m_keys_total_max=200 -average_keys_per_filter=100000 -m_queries=50
          WARNING: Assertions are enabled; benchmarks unnecessarily slow
          Building...
          Build avg ns/key: 125.86
          Number of filters: 1993
          Total size (MB): 168.166
          Reported total allocated memory (MB): 183.211
          Reported internal fragmentation: 8.94626%
          Bits/key stored: 7.05341
          Prelim FP rate %: 0.951827
          ----------------------------
          Mixed inside/outside queries...
            Single filter net ns/op: 48.0111
            Batched, prepared net ns/op: 222.384
            Batched, unprepared net ns/op: 343.908
            Skewed 50% in 1% net ns/op: 252.916
            Skewed 80% in 20% net ns/op: 320.579
            Random filter net ns/op: 332.957
      
      After:
      
          $ ./filter_bench -impl=3 -m_keys_total_max=200 -average_keys_per_filter=100000 -m_queries=50
          WARNING: Assertions are enabled; benchmarks unnecessarily slow
          Building...
          Build avg ns/key: 128.117
          Number of filters: 1993
          Total size (MB): 168.166
          Reported total allocated memory (MB): 183.211
          Reported internal fragmentation: 8.94626%
          Bits/key stored: 7.05341
          Prelim FP rate %: 0.951827
          ----------------------------
          Mixed inside/outside queries...
            Single filter net ns/op: 49.8812
            Batched, prepared net ns/op: 97.1514
            Batched, unprepared net ns/op: 222.025
            Skewed 50% in 1% net ns/op: 197.48
            Skewed 80% in 20% net ns/op: 212.457
            Random filter net ns/op: 226.464
      
      Bloom comparison, for reference:
      
          $ ./filter_bench -impl=2 -m_keys_total_max=200 -average_keys_per_filter=100000 -m_queries=50
          WARNING: Assertions are enabled; benchmarks unnecessarily slow
          Building...
          Build avg ns/key: 35.3042
          Number of filters: 1993
          Total size (MB): 238.488
          Reported total allocated memory (MB): 262.875
          Reported internal fragmentation: 10.2255%
          Bits/key stored: 10.0029
          Prelim FP rate %: 0.965327
          ----------------------------
          Mixed inside/outside queries...
            Single filter net ns/op: 9.09931
            Batched, prepared net ns/op: 34.21
            Batched, unprepared net ns/op: 88.8564
            Skewed 50% in 1% net ns/op: 139.75
            Skewed 80% in 20% net ns/op: 181.264
            Random filter net ns/op: 173.88
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D26378710
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 058428967c55ed763698284cd3b4bbe3351b6e69
      e4f1e64c
    • D
      db_bench: dump cpu info for Mac. (#7932) · 14fbb43f
      David CARLIER 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/7932
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D26316480
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 3e002e49fcb7f60bc9270550a6b3e182fe197551
      14fbb43f
    • X
      Build a full RocksDB on M1 macs (#7943) · 7ebde3da
      Xavier Deguillard 提交于
      Summary:
      With M1 macs being available, it is possible that RocksDB will be built on them, without the resulting artifacts to be intended for iOS, where a non-lite RocksDB is needed.
      
      It is not clear to me why the ROCKSDB_LITE cmake option isn't used for iOS consumer, so sending this pull request as a way to foster discussion and to find a path forward to get a full RocksDB build on M1.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7943
      
      Test Plan:
      Applied the following patch:
      ```
       diff --git a/fbcode/opensource/fbcode_builder/manifests/rocksdb b/fbcode/opensource/fbcode_builder/manifests/rocksdb
       --- a/fbcode/opensource/fbcode_builder/manifests/rocksdb
      +++ b/fbcode/opensource/fbcode_builder/manifests/rocksdb
      @@ -2,8 +2,8 @@
       name = rocksdb
      
       [download]
      -url = https://github.com/facebook/rocksdb/archive/v6.8.1.tar.gz
      -sha256 = ca192a06ed3bcb9f09060add7e9d0daee1ae7a8705a3d5ecbe41867c5e2796a2
      +url = https://github.com/xavierd/rocksdb/archive/master.zip
      +sha256 = f93f3f92df66a8401659e35398749d5910b92bd9c14b8354a35ea8852865c422
      
       [dependencies]
       lz4
      @@ -11,7 +11,7 @@
      
       [build]
       builder = cmake
      -subdir = rocksdb-6.8.1
      +subdir = rocksdb-master
      
       [cmake.defines]
       WITH_SNAPPY=ON
      ```
      
      And ran `getdeps build eden` on an M1 macbook. The build used to fail at link time due to some RocksDB symbols not being found, it now fails for another reason (x86_64 Rust symbols).
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D26324049
      
      Pulled By: xavierd
      
      fbshipit-source-id: 12d86f3395709c4c323f440844e3ae65672aef2d
      7ebde3da
    • Y
      Use actual url instead of tinyurl.com (#7950) · 170dffac
      Yanqin Jin 提交于
      Summary:
      Due to offline discussion, we use actual url of the clang-format-diff.py and add a note.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7950
      
      Reviewed By: pdillinger
      
      Differential Revision: D26370822
      
      Pulled By: riversand963
      
      fbshipit-source-id: 7508e23c002d56d5c1649090438ef5f8ff2cdbe7
      170dffac
    • A
      Makefile support to statically link external plugin code (#7918) · c16d5a4f
      Andrew Kryczka 提交于
      Summary:
      Added support for detecting plugins linked in the "plugin/" directory and building them from our Makefile in a standardized way. See "plugin/README.md" for details. An example of a plugin that can be built in this way can be found in https://github.com/ajkr/dedupfs.
      
      There will be more to do in terms of making this process more convenient and adding support for CMake.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7918
      
      Test Plan: my own plugin (https://github.com/ajkr/dedupfs) and also heard this patch worked with ZenFS.
      
      Reviewed By: pdillinger
      
      Differential Revision: D26189969
      
      Pulled By: ajkr
      
      fbshipit-source-id: 6624d4357d0ffbaedb42f0d12a3fcb737c78f758
      c16d5a4f
  5. 10 2月, 2021 2 次提交
  6. 09 2月, 2021 2 次提交
  7. 07 2月, 2021 1 次提交
  8. 06 2月, 2021 5 次提交
  9. 05 2月, 2021 1 次提交
  10. 04 2月, 2021 1 次提交
  11. 03 2月, 2021 2 次提交
    • L
      Add the integrated BlobDB to the stress/crash tests (#7900) · 0288bdbc
      Levi Tamasi 提交于
      Summary:
      The patch adds support for the options related to the new BlobDB implementation
      to `db_stress`, including support for dynamically adjusting them using `SetOptions`
      when `set_options_one_in` and a new flag `allow_setting_blob_options_dynamically`
      are specified. (The latter is used to prevent the options from being enabled when
      incompatible features are in use.)
      
      The patch also updates the `db_stress` help messages of the existing stacked BlobDB
      related options to clarify that they pertain to the old implementation. In addition, it
      adds the new BlobDB to the crash test script. In order to prevent a combinatorial explosion
      of jobs and still perform whitebox/blackbox testing (including under ASAN/TSAN/UBSAN),
      and to also test BlobDB in conjunction with atomic flush and transactions, the script sets
      the BlobDB options in 10% of normal/`cf_consistency`/`txn` crash test runs.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7900
      
      Test Plan: Ran `make check` and `db_stress`/`db_crashtest.py` with various options.
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D26094913
      
      Pulled By: ltamasi
      
      fbshipit-source-id: c2ef3391a05e43a9687f24e297df05f4a5584814
      0288bdbc
    • Z
      Return Status::OK for unimplemented write batch handler in trace analyzer (#7910) · 108e6b63
      Zhichao Cao 提交于
      Summary:
      The unimplemented handler will return Status::InvalidArgument() and caused issues when using trace analyzer for write batch record. Override with returning Status::OK()
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7910
      
      Test Plan: tested with real trace, make check
      
      Reviewed By: siying
      
      Differential Revision: D26154327
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: bcdefd4891f839b2e89e4c079f9f430245f482fb
      108e6b63
  12. 02 2月, 2021 3 次提交
  13. 30 1月, 2021 2 次提交
    • L
      Fix a SingleDelete related optimization for blob indexes (#7904) · e5311a8e
      Levi Tamasi 提交于
      Summary:
      There is a small `SingleDelete` related optimization in the
      `CompactionIterator` code: when a `SingleDelete`-`Put` pair is preserved
      solely for the purposes of transaction conflict checking, the value
      itself gets cleared. (This is referred to as "optimization 3" in the
      `CompactionIterator` code.) Though the rest of the code got updated to
      support `SingleDelete`'ing blob indexes, this chunk was apparently
      missed, resulting in an assertion failure (or `ROCKS_LOG_FATAL` in release
      builds) when triggered. Note: in addition to clearing the value, we also
      need to update the type of the KV to regular value when dealing with
      blob indexes here.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7904
      
      Test Plan: `make check`
      
      Reviewed By: ajkr
      
      Differential Revision: D26118009
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 6bf78043d20265e2b15c2e1ab8865025040c42ae
      e5311a8e
    • A
      Integrity protection for live updates to WriteBatch (#7748) · 78ee8564
      Andrew Kryczka 提交于
      Summary:
      This PR adds the foundation classes for key-value integrity protection and the first use case: protecting live updates from the source buffers added to `WriteBatch` through the destination buffer in `MemTable`. The width of the protection info is not yet configurable -- only eight bytes per key is supported. This PR allows users to enable protection by constructing `WriteBatch` with `protection_bytes_per_key == 8`. It does not yet expose a way for users to get integrity protection via other write APIs (e.g., `Put()`, `Merge()`, `Delete()`, etc.).
      
      The foundation classes (`ProtectionInfo.*`) embed the coverage info in their type, and provide `Protect.*()` and `Strip.*()` functions to navigate between types with different coverage. For making bytes per key configurable (for powers of two up to eight) in the future, these classes are templated on the unsigned integer type used to store the protection info. That integer contains the XOR'd result of hashes with independent seeds for all covered fields. For integer fields, the hash is computed on the raw unadjusted bytes, so the result is endian-dependent. The most significant bytes are truncated when the hash value (8 bytes) is wider than the protection integer.
      
      When `WriteBatch` is constructed with `protection_bytes_per_key == 8`, we hold a `ProtectionInfoKVOTC` (i.e., one that covers key, value, optype aka `ValueType`, timestamp, and CF ID) for each entry added to the batch. The protection info is generated from the original buffers passed by the user, as well as the original metadata generated internally. When writing to memtable, each entry is transformed to a `ProtectionInfoKVOTS` (i.e., dropping coverage of CF ID and adding coverage of sequence number), since at that point we know the sequence number, and have already selected a memtable corresponding to a particular CF. This protection info is verified once the entry is encoded in the `MemTable` buffer.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7748
      
      Test Plan:
      - an integration test to verify a wide variety of single-byte changes to the encoded `MemTable` buffer are caught
      - add to stress/crash test to verify it works in variety of configs/operations without intentional corruption
      - [deferred] unit tests for `ProtectionInfo.*` classes for edge cases like KV swap, `SliceParts` and `Slice` APIs are interchangeable, etc.
      
      Reviewed By: pdillinger
      
      Differential Revision: D25754492
      
      Pulled By: ajkr
      
      fbshipit-source-id: e481bac6c03c2ab268be41359730f1ceb9964866
      78ee8564
  14. 29 1月, 2021 2 次提交
    • M
      Remove Legacy and Custom FileWrapper classes from header files (#7851) · 4a09d632
      mrambacher 提交于
      Summary:
      Removed the uses of the Legacy FileWrapper classes from the source code.  The wrappers were creating an additional layer of indirection/wrapping, as the Env already has a FileSystem.
      
      Moved the Custom FileWrapper classes into the CustomEnv, as these classes are really for the private use the the CustomEnv class.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7851
      
      Reviewed By: anand1976
      
      Differential Revision: D26114816
      
      Pulled By: mrambacher
      
      fbshipit-source-id: db32840e58d969d3a0fa6c25aaf13d6dcdc74150
      4a09d632
    • M
      Make builds reproducible (#7866) · 0a9a05ae
      mrambacher 提交于
      Summary:
      Closes https://github.com/facebook/rocksdb/issues/7035
      
      Changed how build_version.cc was generated:
      - Included the GIT tag/branch in the build_version file
      - Changed the "Build Date" to be:
            - If the GIT branch is "clean" (no changes), the date of the last git commit
            - If the branch is not clean, the current date
       - Added APIs to access the "build information", rather than accessing the strings directly.
      
      The build_version.cc file is now regenerated whenever the library objects are rebuilt.
      
      Verified that the built files remain the same size across builds on a "clean build" and the same information is reported by sst_dump --version
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7866
      
      Reviewed By: pdillinger
      
      Differential Revision: D26086565
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 6fcbe47f6033989d5cf26a0ccb6dfdd9dd239d7f
      0a9a05ae
  15. 28 1月, 2021 4 次提交
  16. 27 1月, 2021 5 次提交