1. 06 10月, 2021 2 次提交
  2. 04 10月, 2021 1 次提交
    • M
      Fix LITE mode builds on MacOs (#8981) · 78722983
      mrambacher 提交于
      Summary:
      On MacOS, there were errors building in LITE mode related to unused private member variables:
      
      In file included from ./db/compaction/compaction_job.h:20:
      ./db/blob/blob_file_completion_callback.h:87:19: error: private field ‘sst_file_manager_’ is not used [-Werror,-Wunused-private-field]
        SstFileManager* sst_file_manager_;
                        ^
      ./db/blob/blob_file_completion_callback.h:88:22: error: private field ‘mutex_’ is not used [-Werror,-Wunused-private-field]
        InstrumentedMutex* mutex_;
                           ^
      ./db/blob/blob_file_completion_callback.h:89:17: error: private field ‘error_handler_’ is not used [-Werror,-Wunused-private-field]
        ErrorHandler* error_handler_;
      
      This PR resolves those build issues by removing the values as members in LITE mode and fixing the constructor to ignore the input values in LITE mode (otherwise we get unused parameter warnings).
      
      Tested by validating compiles without warnings.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8981
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D31320141
      
      Pulled By: mrambacher
      
      fbshipit-source-id: d67875ebbd39a9555e4f09b2d37159566dd8a085
      78722983
  3. 02 10月, 2021 4 次提交
    • Y
      Add additional checks for three existing unit tests (#8973) · 2cdaf5ca
      Yanqin Jin 提交于
      Summary:
      With test sync points, we can assert on the equality of iterator value in three existing
      unit tests.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8973
      
      Test Plan:
      ```
      gtest-parallel -r 1000 ./db_test2 --gtest_filter=DBTest2.IterRaceFlush2:DBTest2.IterRaceFlush1:DBTest2.IterRefreshRaceFlush
      ```
      
      make check
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D31256340
      
      Pulled By: riversand963
      
      fbshipit-source-id: a9440767ab383e0ec61bd43ffa8fbec4ba562ea2
      2cdaf5ca
    • A
      Enable SingleDelete with user defined ts in db_bench and crash tests (#8971) · 84d71f30
      Akanksha Mahajan 提交于
      Summary:
      Enable SingleDelete with user defined timestamp in db_bench,
      db_stress and crash test
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8971
      
      Test Plan:
      1. For db_stress, ran the command for full duration: i) python3 -u tools/db_crashtest.py
      --enable_ts whitebox --nooverwritepercent=100
      ii) make crash_test_with_ts
      
      2. For db_bench, ran:  ./db_bench -benchmarks=randomreplacekeys
      -user_timestamp_size=8 -use_single_deletes=true
      
      Reviewed By: riversand963
      
      Differential Revision: D31246558
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 29cd8740c9921341e52f09242fca3c44d75a12b7
      84d71f30
    • B
      Update USERS.md (#8923) · e36b9da5
      byronhe 提交于
      Summary:
      fix typo
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8923
      
      Reviewed By: mrambacher
      
      Differential Revision: D31003331
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 00cfcac247621b8bc6d43a3d45c6a11c9dece5b0
      e36b9da5
    • S
      Remove IOSTATS_ADD_IF_POSITIVE() (#8984) · 7f08a850
      sdong 提交于
      Summary:
      IOSTATS_ADD_IF_POSITIVE() doesn't seem to a macro that aims to improve performance but does the opposite. The counter to add is almost always positive so the if is just a waste. Furthermore, adding to a thread local variable seemse to be much cheaper than an if condition if branch prediction has a possibility to be wrong. Remove the macro.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8984
      
      Test Plan: See CI completes.
      
      Reviewed By: anand1976
      
      Differential Revision: D31348163
      
      fbshipit-source-id: 30af6d45e1aa8bbc09b2c046206cce6f67f4777a
      7f08a850
  4. 01 10月, 2021 3 次提交
    • P
      List blob files when using command - list_live_files_metadata (#8976) · e5bfb91d
      Pradeep Ambati 提交于
      Summary:
      The ldb list_live_files_metadata command does not print any information about blob files currently. We would like to add this functionality. Note that list_live_files_metadata has two different modes of operation: the one shown above, which shows the LSM tree structure, and another one, which can be enabled using the flag --sort_by_filename and simply lists the files in numerical order regardless of level. We would like to show blob files in both modes.
      
      Changes:
      1. Using GetAllColumnFamilyMetaData API instead of GetLiveFilesMetaData API for fetching live files data.
      
      Testing:
      1. Created a sample rocksdb instance using dbbench command (this creates both SST and blob files)
      2. Checked if the blob files are listed or not by using ldb commands.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8976
      
      Reviewed By: ltamasi
      
      Differential Revision: D31316061
      
      Pulled By: pradeepambati
      
      fbshipit-source-id: d15cdea192febf7a45f28deee2ba40615d3d84ab
      e5bfb91d
    • P
      ErrorExit if num<1000 for fillsync and fill100K (#8391) · 1953b63c
      Peter (Stig) Edwards 提交于
      Summary:
      This is to avoid an exception and core dump when running
        db_bench -benchmarks fillsync -num 999
      https://github.com/facebook/rocksdb/issues/8390
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8391
      
      Reviewed By: pdillinger
      
      Differential Revision: D29139688
      
      Pulled By: mrambacher
      
      fbshipit-source-id: b9e306728ad25a7aac75f6154699aa852bc07bd1
      1953b63c
    • A
      Don't ignore deletion rate limit if WAL dir is different (#8967) · 532ff334
      anand76 提交于
      Summary:
      If WAL dir is different from the DB dir, we should still honor the SstFileManager deletion rate limit for SST files.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8967
      
      Test Plan: Add a new unit test in db_sst_test
      
      Reviewed By: pdillinger
      
      Differential Revision: D31220116
      
      Pulled By: anand1976
      
      fbshipit-source-id: bcde8a53a7d728e15e597fb5d07ee86c1b38bd28
      532ff334
  5. 30 9月, 2021 2 次提交
  6. 29 9月, 2021 4 次提交
    • M
      Cleanup includes in dbformat.h (#8930) · 13ae16c3
      mrambacher 提交于
      Summary:
      This header file was including everything and the kitchen sink when it did not need to.  This resulted in many places including this header when they needed other pieces instead.
      
      Cleaned up this header to only include what was needed and fixed up the remaining code to include what was now missing.
      
      Hopefully, this sort of code hygiene cleanup will speed up the builds...
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8930
      
      Reviewed By: pdillinger
      
      Differential Revision: D31142788
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 6b45de3f300750c79f751f6227dece9cfd44085d
      13ae16c3
    • A
      Refactor expected state in stress/crash test (#8913) · 559943cd
      Andrew Kryczka 提交于
      Summary:
      This is a precursor refactoring to enable an upcoming feature: persistence failure correctness testing.
      
      - Changed `--expected_values_path` to `--expected_values_dir` and migrated "db_crashtest.py" to use the new flag. For persistence failure correctness testing there are multiple possible correct states since unsynced data is allowed to be dropped. Making it possible to restore all these possible correct states will eventually involve files containing snapshots of expected values and DB trace files.
      - The expected values directory is managed by an `ExpectedStateManager` instance. Managing expected state files is separated out of `SharedState` to prevent `SharedState` from becoming too complex when the new files and features (snapshotting, tracing, and restoring) are introduced.
      - Migrated expected values file access/management out of `SharedState` into a separate class called `ExpectedState`. This is not exposed directly to the test but rather the `ExpectedState` for the latest values file is accessed via a pass-through API on `ExpectedStateManager`. This forces the test to always access the single latest `ExpectedState`.
      - Changed the initialization of the latest expected values file to use a tempfile followed by rename, and also add cleanup logic for possible stranded tempfiles.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8913
      
      Test Plan:
      run in several ways; try to make sure it's not obviously broken.
      
      - crashtest blackbox without TEST_TMPDIR
      ```
      $ python3 tools/db_crashtest.py blackbox --simple --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --duration=120 --interval=10 --compression_type=none --blob_compression_type=none
      ```
      - crashtest blackbox with TEST_TMPDIR
      ```
      $ TEST_TMPDIR=/dev/shm python3 tools/db_crashtest.py blackbox --simple --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --duration=120 --interval=10 --compression_type=none --blob_compression_type=none
      ```
      - crashtest whitebox with TEST_TMPDIR
      ```
      $ TEST_TMPDIR=/dev/shm python3 tools/db_crashtest.py whitebox --simple --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --duration=120 --interval=10 --compression_type=none --blob_compression_type=none --random_kill_odd=88887
      ```
      - db_stress without expected_values_dir
      ```
      $ ./db_stress --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --ops_per_thread=10000 --clear_column_family_one_in=0 --destroy_db_initially=true
      ```
      - db_stress with expected_values_dir and manual corruption
      ```
      $ ./db_stress --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --ops_per_thread=10000 --clear_column_family_one_in=0 --destroy_db_initially=true --expected_values_dir=./
      // modify one byte in "./LATEST.state"
      $ ./db_stress --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --max_key=100000 --value_size_mult=33 --compression_type=none --ops_per_thread=10000 --clear_column_family_one_in=0 --destroy_db_initially=false --expected_values_dir=./
      ...
      Verification failed for column family 0 key 0000000000000000 (0): Value not found: NotFound:
      ...
      ```
      
      Reviewed By: riversand963
      
      Differential Revision: D30921951
      
      Pulled By: ajkr
      
      fbshipit-source-id: babfe218062e55d018c9b046536c0289fb78f41c
      559943cd
    • J
      Add remote compaction read/write bytes statistics (#8939) · 6b34eb0e
      Jay Zhuang 提交于
      Summary:
      Add basic read/write bytes statistics on the primary side:
      `REMOTE_COMPACT_READ_BYTES`
      `REMOTE_COMPACT_WRITE_BYTES`
      
      Fixed existing statistics missing some IO for remote compaction.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8939
      
      Test Plan: CI
      
      Reviewed By: ajkr
      
      Differential Revision: D31074672
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: c57afdba369990185008ffaec7e3fe7c62e8902f
      6b34eb0e
    • H
      Support "level_at_creation" in TablePropertiesCollectorFactory::Context (#8919) · d6bd1a02
      Hui Xiao 提交于
      Summary:
      Context:
      Exposing the level of the sst file (i.e, table) where it is created in `TablePropertiesCollectorFactory::Context` allows users of `TablePropertiesCollectorFactory` to customize some implementation details of `TablePropertiesCollectorFactory` and `TablePropertiesCollector` based on the level of creation. For example, `TablePropertiesCollector::NeedCompact()` can return different values based on level of creation.
      - Declared an extra field `level_at_creation` in `TablePropertiesCollectorFactory::Context`
      - Allowed `level_at_creation` to be passed in as an argument in `IntTblPropCollectorFactory::CreateIntTblPropCollector()` and `UserKeyTablePropertiesCollectorFactory::CreateIntTblPropCollector()`, the latter of which is an internal wrapper of user's passed-in `TablePropertiesCollectorFactory::CreateTablePropertiesCollector()` used in table-building process
      - Called `IntTblPropCollectorFactory::CreateIntTblPropCollector()` with `level_at_creation` passed into both `BlockBasedTableBuilder` and `PlainTableBuilder`
        -  `PlainTableBuilder` previously did not capture `level_at_creation` from `TableBuilderOptions` in `PlainTableFactory`. In order for it to call the method with this parameter, this PR also made `PlainTableBuilder` capture `level_at_creation` as a required parameter
      - Called `IntTblPropCollectorFactory::CreateIntTblPropCollector()` with `level_at_creation` its overridden functions in its derived classes, including `RegularKeysStartWithAFactory::CreateIntTblPropCollector()` in `table_properties_collector_test.cc`, `SstFileWriterPropertiesCollectorFactory::CreateIntTblPropCollector()` in `sst_file_writer_collectors.h`
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8919
      
      Test Plan:
      - Passed the added assertion for `context.level_at_creation`
      - Passed existing tests
      - Run `Make` to make sure adding a required parameter to `PlainTableBuilder`'s constructor does not break anything
      
      Reviewed By: anand1976
      
      Differential Revision: D30951729
      
      Pulled By: hx235
      
      fbshipit-source-id: c4a0173b0d9344a4cf47e1b987d759c1c73cb474
      d6bd1a02
  7. 28 9月, 2021 7 次提交
  8. 27 9月, 2021 1 次提交
    • M
      Make SliceTransform into a Customizable class (#8641) · e0f697d2
      mrambacher 提交于
      Summary:
      Made SliceTransform into a Customizable class.
      
      Would be nice to write a test that stored and used a custom transform  in an SST table.
      
      There are a set of tests (DBBlockFliterTest.PrefixExtractor*, SamePrefixTest.InDomainTest, PrefixTest.PrefixAndWholeKeyTest that run the same with or without a SliceTransform/PrefixFilter.  Is this expected?
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8641
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D31142793
      
      Pulled By: mrambacher
      
      fbshipit-source-id: bb08672fccbfdc263dcae21f25a62307e1facda1
      e0f697d2
  9. 25 9月, 2021 4 次提交
    • Y
      Sort per-file blob read requests by offset (#8953) · b92cef2d
      Yanqin Jin 提交于
      Summary:
      `RandomAccessFileReader::MultiRead()` tries to merge requests in direct IO, assuming input IO requests are
      sorted by offsets.
      
      Add a test in direct IO mode.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8953
      
      Test Plan: make check
      
      Reviewed By: ltamasi
      
      Differential Revision: D31183546
      
      Pulled By: riversand963
      
      fbshipit-source-id: 5d043ec68e2daa47a3149066150afd41ee3d73e6
      b92cef2d
    • A
      Temporarily set experimental_mempurge_threshold=0 in crash test (#8958) · 6d424be9
      Andrew Kryczka 提交于
      Summary:
      For now, disable it since the below command indicates it can cause a
      failure. Running that command with `-experimental_mempurge_threshold=0`
      has been running successfully for several minutes, whereas before it
      failed in seconds.
      
      ```
      $ while rm -rf /dev/shm/single_stress && ./db_stress --clear_column_family_one_in=0 --column_families=1 --db=/dev/shm/single_stress --experimental_mempurge_threshold=5.493146827397074 --flush_one_in=10000 --reopen=0 --write_buffer_size=262144 --value_size_mult=33 --max_write_buffer_number=3 -ops_per_thread=10000; do : ; done
      ```
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8958
      
      Reviewed By: ltamasi
      
      Differential Revision: D31187059
      
      Pulled By: ajkr
      
      fbshipit-source-id: 04d5bfb4fcc4f5b66233e691427dfd940c67037f
      6d424be9
    • A
      Prevent deadlock in db_stress with DbStressCompactionFilter (#8956) · 791bff5b
      Andrew Kryczka 提交于
      Summary:
      The cyclic dependency was:
      
      - `StressTest::OperateDb()` locks the mutex for key 'k'
      - `StressTest::OperateDb()` calls a function like `PauseBackgroundWork()`, which waits for pending compaction to complete.
      - The pending compaction reaches key `k` and `DbStressCompactionFilter::FilterV2()` calls `Lock()` on that key's mutex, which hangs forever.
      
      The cycle can be broken by using a new function, `port::Mutex::TryLock()`, which returns immediately upon failure to acquire a lock. In that case `DbStressCompactionFilter::FilterV2()` can just decide to keep the key.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8956
      
      Reviewed By: riversand963
      
      Differential Revision: D31183718
      
      Pulled By: ajkr
      
      fbshipit-source-id: 329e4a31ce43085af174cf367ef560b5a04399c5
      791bff5b
    • J
      Add microbench build support for fbcode (#8954) · 0595101c
      Jay Zhuang 提交于
      Summary:
      For internal build enviroment only. Developer could run the
      microbenchmark without `ROCKSDB_NO_FBCODE=1`.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8954
      
      Test Plan: `$ make microbench` on dev server
      
      Reviewed By: ajkr
      
      Differential Revision: D31163717
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 1ff59f660ca05afd0fd5c7c7dcdfd831ac365462
      0595101c
  10. 24 9月, 2021 1 次提交
    • S
      FaultInjectionTestFS::InjectThreadSpecificReadError() should not corrupt mmaped bytes (#8952) · 7c6a7e8f
      sdong 提交于
      Summary:
      Right now FaultInjectionTestFS::InjectThreadSpecificReadError() might try to corrupt return bytes, but these bytes might be from mmapped files, which would cause segfault. Instead FaultInjectionTestFS::InjectThreadSpecificReadError() should never corrupt data unless it is in caller's buffer.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8952
      
      Test Plan: See db_stress still runs and make sure in a test run failurs are still injected in non-mmap cases.
      
      Reviewed By: ajkr, ltamasi
      
      Differential Revision: D31147318
      
      fbshipit-source-id: 9484a64ff2aaa36685557203f449286e694e65f9
      7c6a7e8f
  11. 23 9月, 2021 3 次提交
  12. 22 9月, 2021 6 次提交
    • H
      Make RateLimiter::GetTotalPendingRequest() non pure virtual for backward compability (#8938) · 58444ead
      Hui Xiao 提交于
      Summary:
      Context/Summary:
      https://github.com/facebook/rocksdb/pull/8890 added a public API `RateLimiter::GetTotalPendingRequest()` but mistakenly marked it as pure virtual, forcing RateLimiter's derived classes to implement this function and breaking backward compatibility.
      
      This PR makes `RateLimiter::GetTotalPendingRequest()` as non-pure virtual method by providing a trivial implementation in rate_limiter.h
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8938
      
      Test Plan: Passing existing tests
      
      Reviewed By: pdillinger
      
      Differential Revision: D31100661
      
      Pulled By: hx235
      
      fbshipit-source-id: 06eff1005156a6e5a881e393b2c5b2ad706897d8
      58444ead
    • S
      Improve fault injection to MultiRead (#8937) · 93200677
      sdong 提交于
      Summary:
      Several improvements to MultiRead:
      1. Fix a bug in stress test which causes false positive when both MultiRead() return and individual read request have failure injected.
      2. Add two more types of fault that should be handled: empty read results and checksum mismatch
      3. Add a message indicating which type of fault is injected
      4. Increase the failure rate
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8937
      
      Reviewed By: anand1976
      
      Differential Revision: D31085930
      
      fbshipit-source-id: 3a04994a3cadebf9a64d25e1fe12b14b7a272fba
      93200677
    • S
      RandomAccessFileReader::MultiRead() should not return read bytes not read (#8941) · fcce1f2c
      sdong 提交于
      Summary:
      Right now, if underlying read returns fewer bytes than asked for, RandomAccessFileReader::MultiRead() still returns those in the buffer to upper layer. This can be a surprise to upper layer.
      This is unlikely to cause incorrect data. To cause incorrect data, checksum checking in upper layer should pass with short reads, whose chance is low.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8941
      
      Test Plan: Run stress tests for a while
      
      Reviewed By: anand1976
      
      Differential Revision: D31085780
      
      fbshipit-source-id: 999adf2d6c2712f1323d14bb68b678df59969973
      fcce1f2c
    • S
      Fix flaky ldb_cmd_test tests caused by file deletions during validation (#8942) · 1de58866
      sdong 提交于
      Summary:
      In FileChecksumTestHelper::VerifyEachFileChecksum(), we query the file list, and then for each file in the list verify the checksum. However, compaction can delete those files in the mean time and cause failures. To prevent it from happening, disable file deletion during the validation.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8942
      
      Test Plan: Run exsiting test and see it doesn't fail.
      
      Reviewed By: pdillinger
      
      Differential Revision: D31086488
      
      fbshipit-source-id: 554608f36d2dd3bf0a20dfc4039c68bd8533d7f8
      1de58866
    • P
      Finish BackupEngine migration to IOStatus (#8940) · 5268cdc9
      Peter Dillinger 提交于
      Summary:
      Updates a few remaining functions that should have been updated
      from Status -> IOStatus, and adds to HISTORY for the overall change
      including https://github.com/facebook/rocksdb/issues/8820.
      
      This change is for inclusion in version 6.25.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8940
      
      Test Plan: CI
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D31085029
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 91557c6a39ef1d90357d4f4dcd79af0645d87c7b
      5268cdc9
    • M
      Make SystemClock into a Customizable Class (#8636) · 69248698
      mrambacher 提交于
      Summary:
      Made SystemClock into a Customizable class, complete with CreateFromString.
      
      Cleaned up some of the existing SystemClock implementations that were redundant (NoSleep was the same as the internal one for MockEnv).
      
      Changed MockEnv construction to allow Clock to be passed to the Memory/MockFileSystem.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8636
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30483360
      
      Pulled By: mrambacher
      
      fbshipit-source-id: cd0e3a876c39f8c98fe13374c06e8edbd5b9f2a1
      69248698
  13. 21 9月, 2021 1 次提交
  14. 19 9月, 2021 1 次提交