1. 22 6月, 2021 1 次提交
  2. 20 6月, 2021 1 次提交
  3. 19 6月, 2021 4 次提交
    • M
      typo: fix typo in db/write_thread's state (#8423) · 19a89267
      mwish 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8423
      
      Reviewed By: mrambacher
      
      Differential Revision: D29232587
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 04d4937cf0605cbf341a920d1305369a7b8f0574
      19a89267
    • Z
      Trace MultiGet Keys and CF_IDs to the trace file (#8421) · 82a70e14
      Zhichao Cao 提交于
      Summary:
      Tracing the MultiGet information including timestamp, keys, and CF_IDs to the trace file for analyzing and replay.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8421
      
      Test Plan: make check, add test to trace_analyzer_test
      
      Reviewed By: anand1976
      
      Differential Revision: D29221195
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 30c677d6c39ab31ef4bbdf7e0d1fa1fd79f295ff
      82a70e14
    • A
      Change Windows image back to stable (#8424) · d96b0127
      Akanksha Mahajan 提交于
      Summary:
      Since windows timeout issue has been fixed. Change the image back to
      stable.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8424
      
      Test Plan: Check CircleCI jobs
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D29235219
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 2c111f96e216dac4ae3d7ec3b4cdd8e459575d37
      d96b0127
    • A
      Parallelize secondary cache lookup in MultiGet (#8405) · 8ea0a2c1
      anand76 提交于
      Summary:
      Implement the ```WaitAll()``` interface in ```LRUCache``` to allow callers to issue multiple lookups in parallel and wait for all of them to complete. Modify ```MultiGet``` to use this to parallelize the secondary cache lookups in order to reduce the overall latency. A call to ```cache->Lookup()``` returns a handle that has an incomplete value (nullptr), and the caller can call ```cache->IsReady()``` to check whether the lookup is complete, and pass a vector of handles to ```WaitAll``` to wait for completion. If any of the lookups fail, ```MultiGet``` will read the block from the SST file.
      
      Another change in this PR is to rename ```SecondaryCacheHandle``` to ```SecondaryCacheResultHandle``` as it more accurately describes the return result of the secondary cache lookup, which is more like a future.
      
      Tests:
      1. Add unit tests in lru_cache_test
      2. Benchmark results with no secondary cache configured
      Master -
      ```
      readrandom   :      41.175 micros/op 388562 ops/sec;  106.7 MB/s (7277999 of 7277999 found)
      readrandom   :      41.217 micros/op 388160 ops/sec;  106.6 MB/s (7274999 of 7274999 found)
      multireadrandom :      10.309 micros/op 1552082 ops/sec; (28908992 of 28908992 found)
      multireadrandom :      10.321 micros/op 1550218 ops/sec; (29081984 of 29081984 found)
      ```
      
      This PR -
      ```
      readrandom   :      41.158 micros/op 388723 ops/sec;  106.8 MB/s (7290999 of 7290999 found)
      readrandom   :      41.185 micros/op 388463 ops/sec;  106.7 MB/s (7287999 of 7287999 found)
      multireadrandom :      10.277 micros/op 1556801 ops/sec; (29346944 of 29346944 found)
      multireadrandom :      10.253 micros/op 1560539 ops/sec; (29274944 of 29274944 found)
      ```
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8405
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D29190509
      
      Pulled By: anand1976
      
      fbshipit-source-id: 6f8eff6246712af8a297cfe22ea0d1c3b2a01bb0
      8ea0a2c1
  4. 18 6月, 2021 6 次提交
    • 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
    • A
      Don't log a warning if file system doesn't support ReopenWritableFile() (#8414) · 575ea26e
      anand76 提交于
      Summary:
      RocksDB logs a warning if WAL truncation on DB open fails. Its possible that on some file systems, truncation is not required and they would return ```Status::NotSupported()``` for ```ReopenWritableFile```. Don't log a warning in such cases.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8414
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29181738
      
      Pulled By: anand1976
      
      fbshipit-source-id: 6e01e9117e1e4c1d67daa4dcee7fa59d06e057a7
      575ea26e
    • S
      Fix a typo in Javadoc (#8394) · 298edae9
      Sidi Mohamed EL AATIFI 提交于
      Summary:
      iterateLowerBound Slice representing the lower bound
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8394
      
      Reviewed By: ajkr
      
      Differential Revision: D29085721
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: a154375879395c48e9bd3794d296e70316894056
      298edae9
  5. 17 6月, 2021 3 次提交
    • M
      Add Inner method and support for wrapped Customizable (#8373) · d81c2d1e
      mrambacher 提交于
      Summary:
      Inner method added for classes to override to return has-a relationship.  CheckedCast expanded to use Inner to return has-a relationship.
      
      Future Customizable classes (Env, FileSystem, Statistics, etc) will use this feature
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8373
      
      Reviewed By: pdillinger
      
      Differential Revision: D29176369
      
      Pulled By: mrambacher
      
      fbshipit-source-id: cfb6d7702fa365ca4e40c4a50a19e3a534e5ac43
      d81c2d1e
    • Z
      Implementation of Crc32c combine function (#8305) · ecccc631
      Zhichao Cao 提交于
      Summary:
      Implement a function to generate the crc32c of two combined strings. Suppose we have the string 1 (s1) with crc32c checksum crc32c_1 and string 2 (s2) with crc32c checksum crc32c_2, the new string is s1+s2 and its checksum is crc32c_new=Crc32cCombine(crc32c_1, crc32c_2, s2.size).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8305
      
      Test Plan: make check, added new testing case
      
      Reviewed By: pdillinger
      
      Differential Revision: D28651665
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: c84116108388f11a81f6a217b49f99c70d4ffacf
      ecccc631
    • M
      Rename ImmutableOptions variables (#8409) · d5bd0039
      mrambacher 提交于
      Summary:
      This is the next part of the ImmutableOptions cleanup.  After changing the use of ImmutableCFOptions to ImmutableOptions, there were places in the code that had did something like "ImmutableOptions* immutable_cf_options", where "cf" referred to the "old" type.
      
      This change simply renames the variables to match the current type.  No new functionality is introduced.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8409
      
      Reviewed By: pdillinger
      
      Differential Revision: D29166248
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 96de97f8e743f5c5160f02246e3ed8269556dc6f
      d5bd0039
  6. 16 6月, 2021 1 次提交
  7. 15 6月, 2021 8 次提交
    • P
      Remove TSAN crash test opt-in to platform007 (#8406) · 32a4d594
      Peter Dillinger 提交于
      Summary:
      Facebook internal test failure
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8406
      
      Test Plan: COMPILE_WITH_TSAN=1 make crash_test_with_txn
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29124055
      
      Pulled By: pdillinger
      
      fbshipit-source-id: f0f15d6a71435043b19f2170e7500823de1cc43a
      32a4d594
    • M
      Increase range for GeneralTableTest.ApproximateOffsetOfCompressed (#8387) · b788e3f4
      mrambacher 提交于
      Summary:
      Newer versions of Snappy (1.1 patch 8) were failing this test because the offsets were outside of the expected range.
      
      In some experiments:
      - On a RH machine with 1.1.0, the offset of "k04" and "xyy" were 3331 and 6665.
      - On an Ubuntu machine with 1.1.8, the same keys were at 3501 and 7004.
      - On a Mac with 1.1.8, the offsets were 3499 and 7001.
      
      AFAICT, the test environments are either using an older version of Snappy or no Snappy at all.
      
      This change increases the range to allow the tests to pass.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8387
      
      Reviewed By: pdillinger
      
      Differential Revision: D29064475
      
      Pulled By: mrambacher
      
      fbshipit-source-id: fac01927576765b8aff9f57e08a63a2ae210855f
      b788e3f4
    • M
      Add CreateFrom methods to Env/FileSystem (#8174) · 281ac9c8
      mrambacher 提交于
      Summary:
      - Added CreateFromString method to Env and FilesSystem to replace LoadEnv/Load.  This method/signature is a precursor to making these classes extend Customizable.
      
      - Added CreateFromSystem to Env.  This method standardizes creating an Env from the environment variables.  Previously, some places would check TEST_ENV_URI and others would also check TEST_FS_URI.  Now the code is more command/standardized.
      
      - Added CreateFromFlags to Env.  These method allows Env to be create from string options (such as GFLAGS options) in a more standard way.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8174
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D28999603
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 88e6911e7e91f908458a7fe10a20e93ecbc275fb
      281ac9c8
    • J
      Increase cmake test DISCOVERY_TIMEOUT from 5 to 120 seconds (#8403) · 99908db9
      Jay Zhuang 提交于
      Summary:
      cmake test discovery may timeout especially on Windows
      platform. Increase it from default 5 seconds to 120 seconds.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8403
      
      Test Plan: Run Windows build 10 times without issue
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29117455
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 74f71833432f016776a59e070b0f4e146968f81b
      99908db9
    • P
      Clarify some DB::Open,OpenForReadOnly semantics (#8379) · 416dc7be
      Peter Dillinger 提交于
      Summary:
      Longstanding tech debt
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8379
      
      Test Plan: Better than not having an API contract
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29011131
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 2c4796177733651954024fc17875f8642ca08d09
      416dc7be
    • P
      Fix runtime linkage with libasan in Facebook platform009 (#8402) · 3981430f
      Peter Dillinger 提交于
      Summary:
      Was seeing
      
          ./cache_test: error while loading shared libraries: libasan.so.5: cannot open shared object file: No such file or directory
      
      etc. using COMPILE_WITH_ASAN=1 without USE_CLANG=1
      
      Now including compiler libs in runtime ld path.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8402
      
      Test Plan: reproduced with local builds
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29107729
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 13805b87b846b39522c9dd6a231ca245c58f1c71
      3981430f
    • H
      Make CompactionService derived from Customizable (#8395) · dcddc106
      Hui Xiao 提交于
      Summary:
      (1)Make CompactionService derived from Customizable by defining two extra functions that are needed, as described in customizable.h comment section
      (2)Revise the MyTestCompactionService class in compaction_service_test.cc to satisfy the class inheritance requirement
      (3)Specify namespace of ToString() in compaction_service_test.cc to avoid function collision with CompactionService's ancestor classes
      
      Test did:
      make -j24 compaction_service_test
      ./compaction_service_test
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8395
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29076068
      
      Pulled By: hx235
      
      fbshipit-source-id: c130100fa466939b3137e917f5fdc4b2ae8e37d4
      dcddc106
    • A
      Fix Windows build failure (#8400) · 9047fd77
      Akanksha Mahajan 提交于
      Summary:
      Fix window build failure by reverting to previous tag as suggested by CircleCI.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8400
      
      Test Plan: Watch CircleCI builds for a day or two for failure
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29104458
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 5df03092e4b0c221ee12daad7d1fdf8d35eb1082
      9047fd77
  8. 14 6月, 2021 4 次提交
    • P
      Fix^2 use of binutils in Facebook platform009 (#8399) (#8401) · 79407a8a
      Peter Dillinger 提交于
      Summary:
      Internal builds still failing, this time with ld
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8401
      
      Test Plan: Like https://github.com/facebook/rocksdb/issues/8399 but letting build run to completion
      
      Reviewed By: bjlemaire
      
      Differential Revision: D29103512
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 0fcad2c63518cf2b721e749881da40b90f5d3133
      79407a8a
    • P
      Pin CacheEntryStatsCollector to fix performance bug (#8385) · d5a46c40
      Peter Dillinger 提交于
      Summary:
      If the block Cache is full with strict_capacity_limit=false,
      then our CacheEntryStatsCollector could be immediately evicted on
      release, so iterating through column families with shared block cache
      could trigger re-scan for each CF. This change fixes that problem by
      pinning the CacheEntryStatsCollector from InternalStats so that it's not
      evicted.
      
      I had originally thought that this object could participate in LRU like
      everything else, but even though a re-load+re-scan only touches memory,
      it can be orders of magnitude more expensive than other cache misses.
      One service in Facebook has scans that take ~20s over 100GB block cache
      that is mostly 4KB entries. (The up-side of this bug and https://github.com/facebook/rocksdb/issues/8369 is that
      we had a natural experiment on the effect on some service metrics even
      with block cache scans running continuously in the background--a kind
      of worst case scenario. Metrics like latency were not affected enough
      to trigger warnings.)
      
      Other smaller fixes:
      
      20s is already a sizable portion of 600s stats dump period, or 180s
      default max age to force re-scan, so added logic to ensure that (for
      each block cache) we don't spend more than 0.2% of our background thread
      time scanning it. Nevertheless, "foreground" requests for cache entry
      stats (calls to `db->GetMapProperty(DB::Properties::kBlockCacheEntryStats)`)
      are permitted to consume more CPU.
      
      Renamed field to cache_entry_stats_ to match code style.
      
      This change is intended for patching in 6.21 release.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8385
      
      Test Plan:
      unit test expanded to cover new logic (detect regression),
      some manual testing with db_bench
      
      Reviewed By: ajkr
      
      Differential Revision: D29042759
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 236faa902397f50038c618f50fbc8cf3f277308c
      d5a46c40
    • J
      Fix flaky ManualCompactionMax test (#8396) · d60ae5b1
      Jay Zhuang 提交于
      Summary:
      Recalculate the total size after generate new sst files.
      New generated files might have different size as the previous time which
      could cause the test failed.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8396
      
      Test Plan:
      ```
      gtest-parallel ./db_compaction_test
      --gtest_filter=DBCompactionTest.ManualCompactionMax -r 1000 -w 100
      ```
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29083299
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 49d4bd619cefc0f9a1f452f8759ff4c2ba1b6fdb
      d60ae5b1
    • P
      Fix use of binutils in Facebook platform009 (#8399) · 0d0aa578
      Peter Dillinger 提交于
      Summary:
      Internal builds failing
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8399
      
      Test Plan:
      I can reproduce a failure by putting a bad version of `as` in
      my PATH. This indicates that before this change, the custom compiler is
      falsely relying on host `as`. This change fixes that, ignoring the bad
      `as` on PATH.
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D29094159
      
      Pulled By: pdillinger
      
      fbshipit-source-id: c432e90404ea4d39d885a685eebbb08be9eda1c8
      0d0aa578
  9. 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
  10. 12 6月, 2021 3 次提交
    • 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
    • Z
      All the NoSpace() errors will be handled by regular SetBGError and RecoverFromNoSpace() (#8376) · 58162835
      Zhichao Cao 提交于
      Summary:
      In the current logic, any IO Error with retryable flag == true will be handled by the special logic and in most cases, StartRecoverFromRetryableBGIOError will be called to do the auto resume. If the NoSpace error with retryable flag is set during WAL write, it is mapped as a hard error, which will trigger the auto recovery. During the recover process, if write continues and append to the WAL, the write process sees that bg_error is set to HardError and it calls WriteStatusCheck(), which calls SetBGError() with Status (not IOStatus). This will redirect to the regular SetBGError interface, in which recovery_error_ will be set to the corresponding error. With the recovery_error_ set, the auto resume thread created in StartRecoverFromRetryableBGIOError will keep failing as long as user keeps trying to write.
      
      To fix this issue. All the NoSpace error (no matter retryable flag is set or not) will be redirect to the regular SetBGError, and RecoverFromNoSpace() will do the recovery job which calls SstFileManager::StartErrorRecovery().
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8376
      
      Test Plan: make check and added the new testing case
      
      Reviewed By: anand1976
      
      Differential Revision: D29071828
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 7171d7e14cc4620fdab49b7eff7a2fe9a89942c2
      58162835
    • P
      Make platform009 default for FB developers (#8389) · a42a342a
      Peter Dillinger 提交于
      Summary:
      platform007 being phased out and sometimes broken
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8389
      
      Test Plan: `make V=1` to see which compiler is being used
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D29067183
      
      Pulled By: pdillinger
      
      fbshipit-source-id: d1b07267cbc55baa9395f2f4fe3967cc6dad52f7
      a42a342a
  11. 11 6月, 2021 5 次提交
    • M
      Make Comparator into a Customizable Object (#8336) · 6ad08103
      mrambacher 提交于
      Summary:
      Makes the Comparator class into a Customizable object.  Added/Updated the CreateFromString method to create Comparators.  Added test for using the ObjectRegistry to create one.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8336
      
      Reviewed By: jay-zhuang
      
      Differential Revision: D28999612
      
      Pulled By: mrambacher
      
      fbshipit-source-id: bff2cb2814eeb9fef6a00fddc61d6e34b6fbcf2e
      6ad08103
    • A
      Support for Merge in Integrated BlobDB with base values (#8292) · 3897ce31
      Akanksha Mahajan 提交于
      Summary:
      This PR add support for Merge operation in Integrated BlobDB with base values(i.e DB::Put). Merged values can be retrieved through  DB::Get, DB::MultiGet, DB::GetMergeOperands and Iterator operation.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8292
      
      Test Plan: Add new unit tests
      
      Reviewed By: ltamasi
      
      Differential Revision: D28415896
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: e9b3478bef51d2f214fb88c31ed3c8d2f4a531ff
      3897ce31
    • B
      Fixed manifest_dump issues when printing keys and values containing null characters (#8378) · d61a4493
      Baptiste Lemaire 提交于
      Summary:
      Changed fprintf function to fputc in ApplyVersionEdit, and replaced null characters with whitespaces.
      Added unit test in ldb_test.py - verifies that manifest_dump --verbose output is correct when keys and values containing null characters are inserted.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8378
      
      Reviewed By: pdillinger
      
      Differential Revision: D29034584
      
      Pulled By: bjlemaire
      
      fbshipit-source-id: 50833687a8a5f726e247c38457eadc3e6dbab862
      d61a4493
    • 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
    • Z
      Use DbSessionId as cache key prefix when secondary cache is enabled (#8360) · f44e69c6
      Zhichao Cao 提交于
      Summary:
      Currently, we either use the file system inode or a monotonically incrementing runtime ID as the block cache key prefix. However, if we use a monotonically incrementing runtime ID (in the case that the file system does not support inode id generation), in some cases, it cannot ensure uniqueness (e.g., we have secondary cache migrated from host to host). We use DbSessionID (20 bytes) + current file number (at most 10 bytes) as the new cache block key prefix when the secondary cache is enabled. So can accommodate scenarios such as transfer of cache state across hosts.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8360
      
      Test Plan: add the test to lru_cache_test
      
      Reviewed By: pdillinger
      
      Differential Revision: D29006215
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 6cff686b38d83904667a2bd39923cd030df16814
      f44e69c6
  12. 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
  13. 08 6月, 2021 2 次提交
    • P
      Fix a major performance bug in 6.21 for cache entry stats (#8369) · 2f93a3b8
      Peter Dillinger 提交于
      Summary:
      In final polishing of https://github.com/facebook/rocksdb/issues/8297 (after most manual testing), I
      broke my own caching layer by sanitizing an input parameter with
      std::min(0, x) instead of std::max(0, x). I resisted unit testing the
      timing part of the result caching because historically, these test
      are either flaky or difficult to write, and this was not a correctness
      issue. This bug is essentially unnoticeable with a small number
      of column families but can explode background work with a
      large number of column families.
      
      This change fixes the logical error, removes some unnecessary related
      optimization, and adds mock time/sleeps to the unit test to ensure we
      can cache hit within the age limit.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8369
      
      Test Plan: added time testing logic to existing unit test
      
      Reviewed By: ajkr
      
      Differential Revision: D28950892
      
      Pulled By: pdillinger
      
      fbshipit-source-id: e79cd4ff3eec68fd0119d994f1ed468c38026c3b
      2f93a3b8
    • 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