1. 23 9月, 2021 2 次提交
  2. 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
  3. 21 9月, 2021 1 次提交
  4. 19 9月, 2021 1 次提交
  5. 18 9月, 2021 5 次提交
    • J
      RemoteCompaction support Fallback to local compaction (#8709) · 1c290c78
      Jay Zhuang 提交于
      Summary:
      Add support for fallback to local compaction, the user can
      return `CompactionServiceJobStatus::kUseLocal` to instruct RocksDB to
      run the compaction locally instead of waiting for the remote compaction
      result.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8709
      
      Test Plan: unittest
      
      Reviewed By: ajkr
      
      Differential Revision: D30560163
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 65d8905a4a1bc185a68daa120997f21d3198dbe1
      1c290c78
    • Y
      Batch blob read IO for MultiGet (#8699) · b512f4bc
      Yanqin Jin 提交于
      Summary:
      In batched `MultiGet()`, RocksDB batches blob read IO and uses `RandomAccessFileReader::MultiRead()`
      to read the blobs instead of issuing multiple `Read()`.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8699
      
      Test Plan:
      ```
      make check
      ```
      
      Reviewed By: ltamasi
      
      Differential Revision: D31030861
      
      Pulled By: riversand963
      
      fbshipit-source-id: a0df6060cbfd54cff9515a4eee08807b1dbcb0c8
      b512f4bc
    • S
      Fix ldb --try_load_options doesn't use customized Env (#8929) · ba48ff83
      sdong 提交于
      Summary:
      As title. The reason is that after loading customized options, the env is not set back to the correct one. Fix it.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8929
      
      Test Plan: Manually validate in an environment where the command failed.
      
      Reviewed By: riversand963
      
      Differential Revision: D31026931
      
      fbshipit-source-id: c25dc788bf80ed5bf4b24922c442781943bcd65b
      ba48ff83
    • P
      Change `SstFileMetaData::size` from `size_t` to `uint64_t` (#8926) · 4149d044
      Peter Dillinger 提交于
      Summary:
      Because even 32-bit systems can have large files
      
      This is a "change" that I don't want intermingled with an upcoming refactoring.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8926
      
      Test Plan: CI
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D31020974
      
      Pulled By: pdillinger
      
      fbshipit-source-id: ca9eb4510697df6f1f55e37b37730b88b1809a92
      4149d044
    • H
      Improve rate_limiter_test.cc (#8904) · 65411b8d
      Hui Xiao 提交于
      Summary:
      - Fixed a bug in `RateLimiterTest.GeneratePriorityIterationOrder` that the callbacks in this test were not called starting from `i = 1`. Fix by increasing `rate_bytes_per_sec` and requested bytes.
         - The bug is due to the previous `rate_bytes_per_sec` was set too small, resulting in `refill_bytes_per_period`  less than  `kMinRefillBytesPerPeriod`. Hence the actual `refill_bytes_per_period` was equal to `kMinRefillBytesPerPeriod` due to the logic [here](https://github.com/facebook/rocksdb/blob/main/util/rate_limiter.cc#L302-L303)  and it ended up being greater than the previously set requested bytes. Therefore starting from `i = 1`, `RefillBytesAndGrantRequests()` and `GeneratePriorityIterationOrder` won't be called and the test callbacks was not triggered to execute the assertion.
      - Added internal flag to assert callbacks are called in `RateLimiterTest.GeneratePriorityIterationOrder` to prevent any future changes defeat the purpose of the test [as suggested](https://github.com/facebook/rocksdb/pull/8890#discussion_r704915134)
      - Increased `rate_bytes_per_sec` and bytes of each request in `RateLimiterTest.GetTotalBytesThrough`, `RateLimiterTest.GetTotalRequests`, `RateLimiterTest.GetTotalPendingRequests` to trigger the "long path" of execution (i.e, the one trigger RefillBytesAndGrantRequests()) to increase test coverage
         - This increased the running time of the three tests, see test plan for time difference running locally
      - Cleared up sync point effects after each test by calling `SyncPoint::GetInstance()->DisableProcessing();` and `SyncPoint::GetInstance()->ClearAllCallBacks();` in `~RateLimiterTest()` [as suggested](https://github.com/facebook/rocksdb/pull/8595/files#r697534279)
        - It's fine to call these two methods even when `EnableProcessing()` or `SetCallBack()` is not called in the test or is already cleaned up. In those cases, calling these two functions in destructor is effectively no-op.
        - This will allow cleaning up sync point effects of previous test even when the previous test failed in assertion.
      - Added missing `SyncPoint::GetInstance()->DisableProcessing();` and `SyncPoint::GetInstance()->ClearCallBacks(..);` in existing tests for completeness
      - Called `SyncPoint::GetInstance()->DisableProcessing();` and `SyncPoint::GetInstance()->ClearCallBacks(..);` in loop in `RateLimiterTest.GeneratePriorityIterationOrder` for completeness
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8904
      
      Test Plan:
      - Passing existing tests
      - To verify the 1st change, run `RateLimiterTest.GeneratePriorityIterationOrder` with assertions of callbacks are indeed called under original `rate_bytes_per_sec` and request byte and under updated `rate_bytes_per_sec` and request byte. The former will fail the assertion while the latter succeeds.
      - Here is the increased test time due to the 3rd change mentioned above in the summary. The relevant 3 tests mentioned in total increase the test time by 6s (~6000/33848 = 17.7% of the original total test time), which IMO is acceptable for better test coverage through running the "long path".
         - current (run on branch rate_limiter_ut_improve locally)
      
         [ RUN      ] RateLimiterTest.GetTotalBytesThrough
         [       OK ] RateLimiterTest.GetTotalBytesThrough (3000 ms)
         [ RUN      ] RateLimiterTest.GetTotalRequests
         [       OK ] RateLimiterTest.GetTotalRequests (3001 ms)
         [ RUN      ] RateLimiterTest.GetTotalPendingRequests
         [       OK ] RateLimiterTest.GetTotalPendingRequests (0 ms)
         ...
         [----------] 10 tests from RateLimiterTest (43349 ms total)
      
         [----------] Global test environment tear-down
         [==========] 10 tests from 1 test case ran. (43349 ms total)
         [  PASSED  ] 10 tests.
      
         - previous (run on branch main locally)
      
         [ RUN      ] RateLimiterTest.GetTotalBytesThrough
         [       OK ] RateLimiterTest.GetTotalBytesThrough (0 ms)
         [ RUN      ] RateLimiterTest.GetTotalRequests
         [       OK ] RateLimiterTest.GetTotalRequests (0 ms)
         [ RUN      ] RateLimiterTest.GetTotalPendingRequests
         [       OK ] RateLimiterTest.GetTotalPendingRequests (0 ms)
         ...
         [----------] 10 tests from RateLimiterTest (33848 ms total)
      
        [----------] Global test environment tear-down
        [==========] 10 tests from 1 test case ran. (33848 ms total)
        [  PASSED  ] 10 tests.
      
      Reviewed By: ajkr
      
      Differential Revision: D30872544
      
      Pulled By: hx235
      
      fbshipit-source-id: ff894f5c1a4bef70e8e407d53b00be45f776b3e4
      65411b8d
  6. 17 9月, 2021 5 次提交
    • M
      Added a default Name method to Statistics (#8918) · 272cc777
      mrambacher 提交于
      Summary:
      This keeps the implementations/API backward compatible.  Implementations of Statistics will need to override this method (and be registered with the ObjectRegistry) in order to be created via CreateFromString.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8918
      
      Reviewed By: pdillinger
      
      Differential Revision: D30958916
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 75b99a84e9e11fda2a9e8eff9ee1ef69a17517b2
      272cc777
    • A
      Expose blob file information through the EventListener interface (#8675) · d6aa8c49
      Akanksha Mahajan 提交于
      Summary:
      1. Extend FlushJobInfo and CompactionJobInfo with information about the blob files generated by flush/compaction jobs. This PR add two structures BlobFileInfo and BlobFileGarbageInfo that contains the required information of blob files.
       2. Notify the creation and deletion of blob files through OnBlobFileCreationStarted, OnBlobFileCreated, and OnBlobFileDeleted.
       3. Test OnFile*Finish operations notifications with Blob Files.
       4. Log the blob file creation/deletion events through EventLogger in Log file.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8675
      
      Test Plan: Add new unit tests in listener_test
      
      Reviewed By: ltamasi
      
      Differential Revision: D30412613
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: ca51b63c6e8c8d0485a38c503572bc5a82bd5d07
      d6aa8c49
    • S
      Implement TestFSRandomAccessFile::MultiRead() (#8925) · 4f1dd05c
      sdong 提交于
      Summary:
      Right now, the failure injection test for MultiGet() is not sufficient. Improve it with TestFSRandomAccessFile::MultiRead() injecting failures.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8925
      
      Test Plan: Run crash test locally for a while.
      
      Reviewed By: anand1976
      
      Differential Revision: D31000529
      
      fbshipit-source-id: 439c7e02cf7440ac5af82deb609e202abdca3e1f
      4f1dd05c
    • J
      Add compaction priority information in RemoteCompaction (#8707) · b97c53b6
      Jay Zhuang 提交于
      Summary:
      Add compaction priority information in RemoteCompaction, which
      can be used to schedule high priority job first.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8707
      
      Test Plan: unittest
      
      Reviewed By: ajkr
      
      Differential Revision: D30548401
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: b30446511fb31b4583c49edd8565d496cf013a34
      b97c53b6
    • S
      Adjust contrun name (#8924) · 64ca0d9b
      sdong 提交于
      Summary:
      One contrun name is incorrect, which mixed error reporting with another one. Fix it.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8924
      
      Reviewed By: ltamasi
      
      Differential Revision: D30999477
      
      fbshipit-source-id: 46a04b2e4b48f755181aa9a47c353d91f1128469
      64ca0d9b
  7. 16 9月, 2021 6 次提交
    • P
      Fix flaky WALTrashCleanupOnOpen (#8917) · f4a1d106
      Peter Dillinger 提交于
      Summary:
      Test did not consider that slower deletion rate only kicks in
      after a file is deleted
      
      Fixes https://github.com/facebook/rocksdb/issues/7546
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8917
      
      Test Plan:
      no longer reproduces using
      
          buck test mode/dev //internal_repo_rocksdb/repo:db_sst_test -- --exact 'internal_repo_rocksdb/repo:db_sst_test - DBWALTestWithParam/DBWALTestWithParam.WALTrashCleanupOnOpen/0' --jobs 40 --stress-runs 600 --record-results
      
      Reviewed By: siying
      
      Differential Revision: D30949127
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 5d0607f8f548071b07410fe8f532b4618cd225e5
      f4a1d106
    • P
      Fix PrepopulateBlockCache::kFlushOnly (#8750) · 2819c784
      Peter Dillinger 提交于
      Summary:
      kFlushOnly currently means "always" except in the case of
      remote compaction. This makes it flushes only.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8750
      
      Test Plan: test updated
      
      Reviewed By: akankshamahajan15
      
      Differential Revision: D30968034
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 5dbd24dde18852a0e937a540995fba9bfbe89037
      2819c784
    • Z
      Replace Status with IOStatus in the backupable_db (#8820) · 82e7631d
      Zhichao Cao 提交于
      Summary:
      In order to populate the IOStatus up to the higher level, replace some of the Status to IOStatus.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8820
      
      Test Plan: make check
      
      Reviewed By: pdillinger
      
      Differential Revision: D30967215
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: ccf9d5cfbd9d3de047c464aaa85f9fa43b474903
      82e7631d
    • A
      Avoid overwriting first non-OK Status in db_stress setup (#8907) · 5c92aa38
      Andrew Kryczka 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8907
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30922081
      
      Pulled By: ajkr
      
      fbshipit-source-id: ad7a32c21d0049342fd20c9b7f555e93674c3671
      5c92aa38
    • A
      More robust checking of IO uring completion data (#8894) · 7743f033
      anand76 提交于
      Summary:
      Potential bugs in the IO uring implementation can cause bad data to be returned in the completion queue. Add some checks in the PosixRandomAccessFile::MultiRead completion handling code to catch such errors and fail the entire MultiRead. Also log some diagnostic messages and stack trace.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8894
      
      Reviewed By: siying, pdillinger
      
      Differential Revision: D30826982
      
      Pulled By: anand1976
      
      fbshipit-source-id: af91815ac760e095d6cc0466cf8bd5c10167fd15
      7743f033
    • L
      Use the write amplification value calculated by RocksDB in benchmark.sh (#8915) · 8df33434
      Levi Tamasi 提交于
      Summary:
      Currently, `benchmark.sh` computes write amplification itself; the patch
      changes the script to use the value calculated by RocksDB (which is
      printed as part of the periodic statistics). This also has the benefit
      of being correct for BlobDB as well, since it also considers the amount
      of data written to blob files.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8915
      
      Test Plan:
      ```
      DB_DIR=/tmp/rocksdbtest/dbbench/ WAL_DIR=/tmp/rocksdbtest/dbbench/ NUM_KEYS=20000000 NUM_THREADS=32 tools/benchmark.sh overwrite --enable_blob_files=1 --enable_blob_garbage_collection=1
      
      ...
      
      ** Compaction Stats [default] **
      Level    Files   Size     Score Read(GB)  Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) CompMergeCPU(sec) Comp(cnt) Avg(sec) KeyIn KeyDrop Rblob(GB) Wblob(GB)
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        L0      7/5   43.93 MB   0.5      0.3     0.0      0.3       0.5      0.3       0.0   1.0      1.3     59.9    201.35            101.88       109    1.847     22M   499K       0.0      11.2
        L4      4/4   244.03 MB   0.0     11.4     0.3      1.6       1.6      0.0       0.0   1.1     50.6     49.3    231.10            288.84         7   33.014    156M    26M       9.5       9.5
        L5     36/0    3.28 GB   0.0      0.0     0.0      0.0       0.0      0.0       0.0   0.0      0.0      0.0      0.00              0.00         0    0.000       0      0       0.0       0.0
       Sum     47/9    3.56 GB   0.0     11.7     0.3      1.8       2.2      0.3       0.0   2.0     27.6     54.3    432.45            390.72       116    3.728    179M    26M       9.5      20.8
       Int      0/0    0.00 KB   0.0      3.5     0.1      0.5       0.6      0.1       0.0   2.2     31.2     55.6    115.01            109.53        29    3.966     51M  7353K       2.9       5.6
      
      ...
      
      Completed overwrite (ID: ) in 289 seconds
      ops/sec	mb/sec	Size-GB	L0_GB	Sum_GB	W-Amp	W-MB/s	usec/op	p50	p75	p99	p99.9	p99.99	Uptime	Stall-time	Stall%	Test	Date	Version	Job-ID
      111784	44.8	0.0	0.5	2.2	2.0	9.2	285.9	215.3	264.4	1232	13299	23310	243	00:00:0.000	0.0	overwrite.t32.s0	2021-09-14T11:58:26.000-07:00	6.24
      ```
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30940352
      
      Pulled By: ltamasi
      
      fbshipit-source-id: ae7f5cd5440c8529788dda043266121fc2be0853
      8df33434
  8. 15 9月, 2021 4 次提交
    • S
      Always iniitalize ArenaWrappedDBIter::db_iter_ to nullptr (#8889) · 12d798ac
      sdong 提交于
      Summary:
      ArenaWrappedDBIter::db_iter_ should never be nullptr. However, when debugging a segfault, it's hard to distinguish it is not initialized (not possible) and other corruption. Add this nullptr to help distinguish the case.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8889
      
      Test Plan: Run existing unit tests.
      
      Reviewed By: pdillinger
      
      Differential Revision: D30814756
      
      fbshipit-source-id: 4b1f36896a33dc203d4f1f424ded9554927d61ba
      12d798ac
    • A
      Adapt key-value checksum for timestamp-suffixed keys (#8914) · d648cb47
      Andrew Kryczka 提交于
      Summary:
      After https://github.com/facebook/rocksdb/issues/8725, keys added to `WriteBatch` may be timestamp-suffixed, while `WriteBatch` has no awareness of the timestamp size. Therefore, `WriteBatch` can no longer calculate timestamp checksum separately from the rest of the key's checksum in all cases.
      
      This PR changes the definition of key in KV checksum to include the timestamp suffix. That way we do not need to worry about where the timestamp begins within the key. I believe the only practical effect of this change is now `AssignTimestamp()` requires recomputing the whole key checksum (`UpdateK()`) rather than just the timestamp portion (`UpdateT()`).
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8914
      
      Test Plan:
      run stress command that used to fail
      
      ```
      $ ./db_stress --batch_protection_bytes_per_key=8 -clear_column_family_one_in=0 -test_batches_snapshots=1
      ```
      
      Reviewed By: riversand963
      
      Differential Revision: D30925715
      
      Pulled By: ajkr
      
      fbshipit-source-id: c143f7ccb46c0efb390ad57ef415c250d754deff
      d648cb47
    • A
      Improve benchmark.sh (#8730) · e10e4162
      Adam Retter 提交于
      Summary:
      * Started on some proper usage text to document the options
      * Added a `JOB_ID` parameter, so that we can trace jobs and relate them to other assets
      * Now generates a correct TSV file of the summary
      * Summary has new additional fields:
          * RocksDB Version
          * Date
          * Job ID
      * db_bench log files now also include the Job ID
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8730
      
      Reviewed By: mrambacher
      
      Differential Revision: D30747344
      
      Pulled By: jay-zhuang
      
      fbshipit-source-id: 87eb78d20959b6d95804aebf129606fa9c71f407
      e10e4162
    • C
      Add Kafka to USERS (#8911) · 34afdc2d
      Cheng Chang 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8911
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30908552
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: df2ab50d94ed46bfb54f0dd520f8a5cdbfa49fd1
      34afdc2d
  9. 14 9月, 2021 5 次提交
  10. 13 9月, 2021 2 次提交
    • M
      Change the File System File Wrappers to std::unique_ptr (#8618) · dafa584f
      mrambacher 提交于
      Summary:
      This allows the wrapper classes to own the wrapped object and eliminates confusion as to ownership.  Previously, many classes implemented their own ownership solutions.  Fixes https://github.com/facebook/rocksdb/issues/8606
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8618
      
      Reviewed By: pdillinger
      
      Differential Revision: D30136064
      
      Pulled By: mrambacher
      
      fbshipit-source-id: d0bf471df8818dbb1770a86335fe98f761cca193
      dafa584f
    • Y
      Allow WriteBatch to have keys with different timestamp sizes (#8725) · 2a2b3e03
      Yanqin Jin 提交于
      Summary:
      In the past, we unnecessarily requires all keys in the same write batch
      to be from column families whose timestamps' formats are the same for
      simplicity. Specifically, we cannot use the same write batch to write to
      two column families, one of which enables timestamp while the other
      disables it.
      
      The limitation is due to the member `timestamp_size_` that used to exist
      in each `WriteBatch` object. We pass a timestamp_size to the constructor
      of `WriteBatch`. Therefore, users can simply use the old
      `WriteBatch::Put()`, `WriteBatch::Delete()`, etc APIs for write, while
      the internal implementation of `WriteBatch` will take care of memory
      allocation for timestamps.
      
      The above is not necessary.
      One the one hand, users can set up a memory buffer to store user key and
      then contiguously append the timestamp to the user key. Then the user
      can pass this buffer to the `WriteBatch::Put(Slice&)` API.
      On the other hand, users can set up a SliceParts object which is an
      array of Slices and let the last Slice to point to the memory buffer
      storing timestamp. Then the user can pass the SliceParts object to the
      `WriteBatch::Put(SliceParts&)` API.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8725
      
      Test Plan: make check
      
      Reviewed By: ltamasi
      
      Differential Revision: D30654499
      
      Pulled By: riversand963
      
      fbshipit-source-id: 9d848c77ad3c9dd629aa5fc4e2bc16fb0687b4a2
      2a2b3e03
  11. 12 9月, 2021 1 次提交
  12. 11 9月, 2021 2 次提交
    • P
      Fix and detect headers with missing dependencies (#8893) · bda8d93b
      Peter Dillinger 提交于
      Summary:
      It's always annoying to find a header does not include its own
      dependencies and only works when included after other includes. This
      change adds `make check-headers` which validates that each header can
      be included at the top of a file. Some headers are excluded e.g. because
      of platform or external dependencies.
      
      rocksdb_namespace.h had to be re-worked slightly to enable checking for
      failure to include it. (ROCKSDB_NAMESPACE is a valid namespace name.)
      
      Fixes mostly involve adding and cleaning up #includes, but for
      FileTraceWriter, a constructor was out-of-lined to make a forward
      declaration sufficient.
      
      This check is not currently run with `make check` but is added to
      CircleCI build-linux-unity since that one is already relatively fast.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8893
      
      Test Plan: existing tests and resolving issues detected by new check
      
      Reviewed By: mrambacher
      
      Differential Revision: D30823300
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 9fff223944994c83c105e2e6496d24845dc8e572
      bda8d93b
    • M
      Make Statistics a Customizable Class (#8637) · dc0dc90c
      mrambacher 提交于
      Summary:
      Make the Statistics object into a Customizable object.  Statistics can now be stored and created to/from the Options file.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8637
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D30530550
      
      Pulled By: mrambacher
      
      fbshipit-source-id: 5fc7d01d8431f37b2c205bbbd8342c9f697023bd
      dc0dc90c