1. 06 8月, 2021 1 次提交
  2. 05 8月, 2021 2 次提交
  3. 04 8月, 2021 2 次提交
  4. 03 8月, 2021 1 次提交
  5. 31 7月, 2021 1 次提交
    • M
      Allow WAL dir to change with db dir (#8582) · ab7f7c9e
      mrambacher 提交于
      Summary:
      Prior to this change, the "wal_dir"  DBOption would always be set (defaults to dbname) when the DBOptions were sanitized.  Because of this setitng in the options file, it was not possible to rename/relocate a database directory after it had been created and use the existing options file.
      
      After this change, the "wal_dir" option is only set under specific circumstances.  Methods were added to the ImmutableDBOptions class to see if it is set and if it is set to something other than the dbname.  Additionally, a method was added to retrieve the effective value of the WAL dir (either the option or the dbname/path).
      
      Tests were added to the core and ldb to test that a database could be created and renamed without issue.  Additional tests for various permutations of wal_dir were also added.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8582
      
      Reviewed By: pdillinger, autopear
      
      Differential Revision: D29881122
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 67d3d033dc8813d59917b0a3fba2550c0efd6dfb
      ab7f7c9e
  6. 29 7月, 2021 1 次提交
  7. 27 7月, 2021 1 次提交
    • M
      Make EventListener into a Customizable Class (#8473) · 3aee4fbd
      mrambacher 提交于
      Summary:
      - Added Type/CreateFromString
      - Added ability to load EventListeners to DBOptions
      - Since EventListeners did not previously have a Name(), defaulted to "".  If there is no name, the listener cannot be loaded from the ObjectRegistry.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8473
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D29901488
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 2d3a4aa6db1562ac03e7ad41b360e3521d486254
      3aee4fbd
  8. 23 7月, 2021 1 次提交
  9. 22 7月, 2021 1 次提交
    • J
      Avoid updating option if there's no value updated (#8518) · 42eaa45c
      Jay Zhuang 提交于
      Summary:
      Try avoid expensive updating options operation if
      `SetDBOptions()` does not change any option value.
      Skip updating is not guaranteed, for example, changing `bytes_per_sync`
      to `0` may still trigger updating, as the value could be sanitized.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8518
      
      Test Plan: added unittest
      
      Reviewed By: riversand963
      
      Differential Revision: D29672639
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: b7931de62ceea6f1bdff0d1209adf1197d3ed1f4
      42eaa45c
  10. 17 7月, 2021 1 次提交
  11. 14 7月, 2021 1 次提交
  12. 12 7月, 2021 1 次提交
    • A
      Avoid passing existing BG error to WriteStatusCheck (#8511) · d1b70b05
      anand76 提交于
      Summary:
      In ```DBImpl::WriteImpl()```, we call ```PreprocessWrite()``` which, among other things, checks the BG error and returns it set. This return status is later on passed to ```WriteStatusCheck()```, which calls ```SetBGError()```. This results in a spurious call, and info logs, on every user write request. We should avoid passing the ```PreprocessWrite()``` return status to ```WriteStatusCheck()```, as the former would have called ```SetBGError()``` already if it encountered any new errors, such as error when creating a new WAL file.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8511
      
      Test Plan: Run existing tests
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D29639917
      
      Pulled By: anand1976
      
      fbshipit-source-id: 19234163969e1645dbeb273712aaf5cd9ea2b182
      d1b70b05
  13. 07 7月, 2021 1 次提交
  14. 02 7月, 2021 1 次提交
  15. 30 6月, 2021 2 次提交
  16. 28 6月, 2021 1 次提交
    • M
      Add BlobMetaData retrieval methods (#8273) · be219089
      mrambacher 提交于
      Summary:
      Added BlobMetaData to ColumnFamilyMetaData and LiveBlobMetaData and DB API GetLiveBlobMetaData to retrieve it.
      
      First pass at struct.  More tests and maybe fields to come...
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8273
      
      Reviewed By: ltamasi
      
      Differential Revision: D29102400
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 8a2383a4446328be6b91dced9841fdd3dfc80b73
      be219089
  17. 26 6月, 2021 1 次提交
  18. 25 6月, 2021 2 次提交
  19. 23 6月, 2021 5 次提交
    • B
      Add list live files metadata (#8446) · 3f20925d
      Baptiste Lemaire 提交于
      Summary:
      Add an argument to ldb to dump live file names, column families, and levels, `list_live_files_metadata`. The output shows all active SST file names, sorted first by column family and then by level. For each level the SST files are sorted alphabetically.
      
      Typically, the output looks like this:
      ```
      ./ldb --db=/tmp/test_db list_live_files_metadata
      Live SST Files:
      ===== Column Family: default =====
      ---------- level 0 ----------
      /tmp/test_db/000069.sst
      ---------- level 1 ----------
      /tmp/test_db/000064.sst
      /tmp/test_db/000065.sst
      /tmp/test_db/000066.sst
      /tmp/test_db/000071.sst
      ---------- level 2 ----------
      /tmp/test_db/000038.sst
      /tmp/test_db/000039.sst
      /tmp/test_db/000052.sst
      /tmp/test_db/000067.sst
      /tmp/test_db/000070.sst
      ------------------------------
      ```
      
      Second, a flag was added `--sort_by_filename`, to change the layout of the output. When this flag is added to the command, the output shows all active SST files sorted by name, in front of which the LSM level and the column family are mentioned. With the same example, the following command would return:
      ```
      ./ldb --db=/tmp/test_db list_live_files_metadata --sort_by_filename
      Live SST Files:
      /tmp/test_db/000038.sst : level 2, column family 'default'
      /tmp/test_db/000039.sst : level 2, column family 'default'
      /tmp/test_db/000052.sst : level 2, column family 'default'
      /tmp/test_db/000064.sst : level 1, column family 'default'
      /tmp/test_db/000065.sst : level 1, column family 'default'
      /tmp/test_db/000066.sst : level 1, column family 'default'
      /tmp/test_db/000067.sst : level 2, column family 'default'
      /tmp/test_db/000069.sst : level 0, column family 'default'
      /tmp/test_db/000070.sst : level 2, column family 'default'
      /tmp/test_db/000071.sst : level 1, column family 'default'
      ------------------------------
      ```
      
      Thus, the user can either request to show the files by levels, or sorted by filenames.
      This PR includes a simple Python unit test that makes sure the file name and level printed out by this new feature matches the one found with an existing feature, `dump_live_file`.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8446
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29320080
      
      Pulled By: bjlemaire
      
      fbshipit-source-id: 01fb7b5637c59010d74c80730a28d815994e7009
      3f20925d
    • L
      Update HISTORY.md for PR 8437 (#8442) · 005c0467
      Levi Tamasi 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8442
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29306432
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 0fe55736368ac024b2f51213b65f4b06d71d60e6
      005c0467
    • J
      Revert "Revert "Snapshot release triggered compaction without multiple... · f89423a5
      Jay Zhuang 提交于
      Revert "Revert "Snapshot release triggered compaction without multiple tombstones (#8357)" (#8410)" (#8438)
      
      Summary:
      This reverts commit 25be1ed6.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8438
      
      Test Plan: Run the impacted mysql test 40 times
      
      Reviewed By: ajkr
      
      Differential Revision: D29286247
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: d3bd056971a19a8b012d5d0295fa045c012b3c04
      f89423a5
    • A
      Fixup HISTORY.md for 6.22 release (#8441) · b511b042
      Andrew Kryczka 提交于
      Summary:
      `git diff origin/6.21.fb origin/6.22.fb -- HISTORY.md` looked odd.
      This PR fixes it up by moving items from 6.21.0 to 6.22.0 that were
      never in any 6.21 release. Also mentioned the background stat collection
      fix under 6.22 (previously it was mentioned under 6.21 patch releases
      only).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8441
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29304812
      
      Pulled By: ajkr
      
      fbshipit-source-id: 2a928a9518a1d6615321d5c2d1e22b17cbb59093
      b511b042
    • J
      Fix DeleteFilesInRange may cause inconsistent compaction error (#8434) · 54d73d64
      Jay Zhuang 提交于
      Summary:
      `DeleteFilesInRange()` marks deleting files to `being_compacted`
      before deleting, which may cause ongoing compactions report corruption
      exception or ASSERT for debug build.
      
      Adding the missing `ComputeCompactionScore()` when `being_compacted` is set.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8434
      
      Test Plan: Unittest
      
      Reviewed By: ajkr
      
      Differential Revision: D29276127
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: f5b223e3c1fc6d821e100e3f3442bc70c1d50cf7
      54d73d64
  20. 20 6月, 2021 1 次提交
  21. 18 6月, 2021 4 次提交
    • B
      Added memtable garbage statistics (#8411) · e817bc96
      Baptiste Lemaire 提交于
      Summary:
      **Summary**:
      2 new statistics counters are added to RocksDB: `MEMTABLE_PAYLOAD_BYTES_AT_FLUSH` and `MEMTABLE_GARBAGE_BYTES_AT_FLUSH`. The former tracks how many raw bytes of useful data are present on the memtable at flush time, whereas the latter is tracks how many of these raw bytes are considered garbage, meaning that they ended up not being imported on the SSTables resulting from the flush operations.
      
      **Unit test**: run `make db_flush_test -j$(nproc); ./db_flush_test` to run the unit test.
      This executable includes 3 tests, that test support and correct stat calculations for workloads with inserts, deletes, and DeleteRanges. The parameters are set such that the workloads are performed on a single memtable, and a single SSTable is created as a result of the flush operation. The flush operation is manually called in the test file. The tests verify that the values of these 2 statistics counters introduced in this PR  can be exactly predicted, showing that we have a full understanding of the underlying operations.
      
      **Performance testing**:
      `./db_bench -statistics -benchmarks=fillrandom -num=10000000` repeated 10 times.
      Timing done using "date" function in a bash script.
      _Results_:
      Original Rocksdb fork: mean 66.6 sec, std 1.18 sec.
      This feature branch: mean 67.4 sec, std 1.35 sec.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8411
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29150629
      
      Pulled By: bjlemaire
      
      fbshipit-source-id: 7b3c2e86d50c6aa34fa50fd134282eacb543a5b1
      e817bc96
    • A
      Cache warming data blocks during flush (#8242) · 5ba1b6e5
      Akanksha Mahajan 提交于
      Summary:
      This PR prepopulates warm/hot data blocks which are already in memory
      into block cache at the time of flush. On a flush, the data block that is
      in memory (in memtables) get flushed to the device. If using Direct IO,
      additional IO is incurred to read this data back into memory again, which
      is avoided by enabling newly added option.
      
       Right now, this is enabled only for flush for data blocks. We plan to
      expand this option to cover compactions in the future and for other types
       of blocks.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8242
      
      Test Plan: Add new unit test
      
      Reviewed By: anand1976
      
      Differential Revision: D28521703
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 7219d6958821cedce689a219c3963a6f1a9d5f05
      5ba1b6e5
    • Add DeteleRange support for DBWithTTL (#8384) · d53f7ff6
      聂佩轩 提交于
      Summary:
      This commit is for enabling `DBWithTTL` to use `DeteleRange` which it cannot before.
      As (int32_t)Timestamp is suffixed to values in `DBWithTTL`, there is no reason that it
      cannot use the common used api. I added `DeleteRangeCF` in `DBWithTTLImpl::Write`
      so that we can use `DeteleRange` normally. When we run code like
      `dbWithTtl->DeleteRange(start, end)`, it executes`WriteBatchInternal::DeleteRange`
      internally. Intended to fix https://github.com/facebook/rocksdb/issues/7218
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8384
      
      Test Plan: added corresponded testing logic to existing unit test
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29176734
      
      fbshipit-source-id: 6874ed979fc08e1d138149d03653e43a75f0e0e6
      d53f7ff6
    • P
      Mark Ribbon filter and optimize_filters_for_memory as production (#8408) · 865a2510
      Peter Dillinger 提交于
      Summary:
      Marked the Ribbon filter and optimize_filters_for_memory features
      as production-ready, each enabling memory savings for Bloom-like filters.
      Use `NewRibbonFilterPolicy` in place of `NewBloomFilterPolicy` to use
      Ribbon filters instead of Bloom, or `ribbonfilter` in place of
      `bloomfilter` in configuration string.
      
      Some small refactoring in db_stress.
      
      Removed/refactored unused code in db_bench, in part preparing for future
      default possibly being different from "disabled."
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8408
      
      Test Plan:
      Lots of prior automated, ad-hoc, and "real world" testing.
      Updated tests for new API names. Quick db_bench test:
      
      bloom fillrandom
      77730 ops/sec
      rocksdb.block.cache.filter.bytes.insert COUNT : 89929384
      
      ribbon fillrandom
      71492 ops/sec
      rocksdb.block.cache.filter.bytes.insert COUNT : 64531384
      
      Reviewed By: mrambacher
      
      Differential Revision: D29140805
      
      Pulled By: pdillinger
      
      fbshipit-source-id: d742c922722421678f95ad85eeb0aaebc9f5e49a
      865a2510
  22. 16 6月, 2021 1 次提交
  23. 13 6月, 2021 1 次提交
    • L
      Disable subcompactions for user-defined timestamps (#8393) · 14626388
      Levi Tamasi 提交于
      Summary:
      The subcompaction boundary picking logic does not currently guarantee
      that all user keys that differ only by timestamp get processed by the same
      subcompaction. This can cause issues with the `CompactionIterator` state
      machine: for instance, one subcompaction that processes a subset of such KVs
      might drop a tombstone based on the KVs it sees, while in reality the
      tombstone might not have been eligible to be optimized out.
      (See also https://github.com/facebook/rocksdb/issues/6645, which adjusted the way compaction inputs are picked for the
      same reason.)
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8393
      
      Test Plan: Ran `make check` and the crash test script with timestamps enabled.
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29071635
      
      Pulled By: ltamasi
      
      fbshipit-source-id: f6c72442122b4e581871e096fabe3876a9e8a5a6
      14626388
  24. 12 6月, 2021 1 次提交
    • P
      Fix double-dumping CF stats to log (#8380) · b3dbeadc
      Peter Dillinger 提交于
      Summary:
      DBImpl::DumpStats is supposed to do this:
      Dump DB stats to LOG
      For each CF, dump CFStatsNoFileHistogram to LOG
      For each CF, dump CFFileHistogram to LOG
      
      Instead, due to a longstanding bug from 2017 (https://github.com/facebook/rocksdb/issues/2126), it would dump
      CFStats, which includes both CFStatsNoFileHistogram and CFFileHistogram,
      in both loops, resulting in near-duplicate output.
      
      This fixes the bug.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8380
      
      Test Plan: Manual inspection of LOG after db_bench
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29017535
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 3010604c4a629a80347f129cd746ce9b0d0cbda6
      b3dbeadc
  25. 11 6月, 2021 1 次提交
    • M
      BugFix: fs_posix.cc GetFreeSpace uses wrong value non-root users (#8370) · 5a2b4ed6
      matthewvon 提交于
      Summary:
      fs_posix.cc GetFreeSpace() calculates free space based upon a call to statvfs().  However, there are two extremely different values in statvfs's returned structure:  f_bfree which is free space for root and f_bavail which is free space for non-root users.  The existing code uses f_bfree.  Many disks have 5 to 10% of the total disk space reserved for root only.  Therefore GetFreeSpace() does not realize that non-root users may not have storage available.
      
      This PR detects whether the effective posix user is root or not, then selects the appropriate available space value.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8370
      
      Reviewed By: mrambacher
      
      Differential Revision: D29032710
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 57feba34ed035615a479956d28f98d85735281c0
      5a2b4ed6
  26. 08 6月, 2021 1 次提交
    • D
      Cancel compact range (#8351) · 80a59a03
      David Devecsery 提交于
      Summary:
      Added the ability to cancel an in-progress range compaction by storing to an atomic "canceled" variable pointed to within the CompactRangeOptions structure.
      
      Tested via two tests added to db_tests2.cc.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8351
      
      Reviewed By: ajkr
      
      Differential Revision: D28808894
      
      Pulled By: ddevec
      
      fbshipit-source-id: cb321361c9e23b084b188bb203f11c375a22c2dd
      80a59a03
  27. 04 6月, 2021 2 次提交
    • A
      Snapshot release triggered compaction without multiple tombstones (#8357) · 9167ece5
      Andrew Kryczka 提交于
      Summary:
      This is a duplicate of https://github.com/facebook/rocksdb/issues/4948 by mzhaom to fix tests after rebase.
      
      This change is a follow-up to https://github.com/facebook/rocksdb/issues/4927, which made this possible by allowing tombstone dropping/seqnum zeroing optimizations on the last key in the compaction. Now the `largest_seqno != 0` condition suffices to prevent snapshot release triggered compaction from entering an infinite loop.
      
      The issues caused by the extraneous condition `level_and_file.second->num_deletions > 1` are:
      
      - files could have `largest_seqno > 0` forever making it impossible to tell they cannot contain any covering keys
      - it doesn't trigger compaction when there are many overwritten keys. Some MyRocks use case actually doesn't use Delete but instead calls Put with empty value to "delete" keys, so we'd like to be able to trigger compaction in this case too.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8357
      
      Test Plan: - make check
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D28855340
      
      Pulled By: ajkr
      
      fbshipit-source-id: a261b51eecafec492499e6d01e8e43112f801798
      9167ece5
    • A
      Update HISTORY and version to 6.21 (#8363) · 799cf37c
      anand76 提交于
      Summary:
      Update HISTORY and version to 6.21 on master.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8363
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D28888818
      
      Pulled By: anand1976
      
      fbshipit-source-id: 9e5fac3b99ecc9f3b7d9f21474a39fa50decb117
      799cf37c
  28. 26 5月, 2021 1 次提交