1. 24 8月, 2021 1 次提交
  2. 12 8月, 2021 1 次提交
    • M
      Make TraceRecord and Replayer public (#8611) · f58d2767
      Merlin Mao 提交于
      Summary:
      New public interfaces:
      `TraceRecord` and `TraceRecord::Handler`, available in "rocksdb/trace_record.h".
      `Replayer`, available in `rocksdb/utilities/replayer.h`.
      
      User can use `DB::NewDefaultReplayer()` to create a Replayer to auto/manual replay a trace file.
      
      Unit tests:
      - `./db_test2 --gtest_filter="DBTest2.TraceAndReplay"`: Updated with the internal API changes.
      - `./db_test2 --gtest_filter="DBTest2.TraceAndManualReplay"`: New for manual replay.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8611
      
      Reviewed By: ajkr
      
      Differential Revision: D30266329
      
      Pulled By: autopear
      
      fbshipit-source-id: 1ecb3cbbedae0f6a67c18f0cc82e002b4d81b6f8
      f58d2767
  3. 23 7月, 2021 1 次提交
    • Z
      Analyze MultiGet in trace_analyzer (#8575) · 61c9bd49
      Zhichao Cao 提交于
      Summary:
      Now we can analyze the MultiGet queries in the trace file and generate a set of the statistic and analysis files. Note that, when one MultiGet access N keys, we count each sub-get-query individually. But the over all query number is still the MultiGet not the sub-get-query.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8575
      
      Test Plan: added new unit test and make check
      
      Reviewed By: anand1976
      
      Differential Revision: D29860633
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: a132128527f36828d266df8e36e3ec626c2170be
      61c9bd49
  4. 19 6月, 2021 1 次提交
  5. 10 3月, 2021 1 次提交
    • P
      Refactor: add LineFileReader and Status::MustCheck (#8026) · 4b18c46d
      Peter Dillinger 提交于
      Summary:
      Removed confusing, awkward, and undocumented internal API
      ReadOneLine and replaced with very simple LineFileReader.
      
      In refactoring backupable_db.cc, this has the side benefit of
      removing the arbitrary cap on the size of backup metadata files.
      
      Also added Status::MustCheck to make it easy to mark a Status as
      "must check." Using this, I can ensure that after
      LineFileReader::ReadLine returns false the caller checks GetStatus().
      
      Also removed some excessive conditional compilation in status.h
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/8026
      
      Test Plan: added unit test, and running tests with ASSERT_STATUS_CHECKED
      
      Reviewed By: mrambacher
      
      Differential Revision: D26831687
      
      Pulled By: pdillinger
      
      fbshipit-source-id: ef749c265a7a26bb13cd44f6f0f97db2955f6f0f
      4b18c46d
  6. 19 2月, 2021 1 次提交
    • Z
      Introduce a new trace file format (v 0.2) for better extension (#7977) · b0fd1cc4
      Zhichao Cao 提交于
      Summary:
      The trace file record and payload encode is fixed, which requires complex backward compatibility resolving. This PR introduce a new trace file format, which makes it easier to add new entries to the payload and does not have backward compatible issues. V 0.1 is still supported in this PR. Added the tracing for lower_bound and upper_bound for iterator.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7977
      
      Test Plan: make check. tested with old trace file in replay and analyzing.
      
      Reviewed By: anand1976
      
      Differential Revision: D26529948
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: ebb75a127ce3c07c25a1ccc194c551f917896a76
      b0fd1cc4
  7. 29 1月, 2021 1 次提交
    • M
      Remove Legacy and Custom FileWrapper classes from header files (#7851) · 4a09d632
      mrambacher 提交于
      Summary:
      Removed the uses of the Legacy FileWrapper classes from the source code.  The wrappers were creating an additional layer of indirection/wrapping, as the Env already has a FileSystem.
      
      Moved the Custom FileWrapper classes into the CustomEnv, as these classes are really for the private use the the CustomEnv class.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7851
      
      Reviewed By: anand1976
      
      Differential Revision: D26114816
      
      Pulled By: mrambacher
      
      fbshipit-source-id: db32840e58d969d3a0fa6c25aaf13d6dcdc74150
      4a09d632
  8. 29 10月, 2020 1 次提交
    • Y
      Remove unused includes (#7604) · 394210f2
      Yanqin Jin 提交于
      Summary:
      This is a PR generated **semi-automatically** by an internal tool to remove unused includes and `using` statements.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7604
      
      Test Plan: make check
      
      Reviewed By: ajkr
      
      Differential Revision: D24579392
      
      Pulled By: riversand963
      
      fbshipit-source-id: c4bfa6c6b08da1de186690d37eb73d8fff45aecd
      394210f2
  9. 02 10月, 2020 1 次提交
  10. 15 9月, 2020 1 次提交
  11. 21 2月, 2020 1 次提交
    • S
      Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) · fdf882de
      sdong 提交于
      Summary:
      When dynamically linking two binaries together, different builds of RocksDB from two sources might cause errors. To provide a tool for user to solve the problem, the RocksDB namespace is changed to a flag which can be overridden in build time.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6433
      
      Test Plan: Build release, all and jtest. Try to build with ROCKSDB_NAMESPACE with another flag.
      
      Differential Revision: D19977691
      
      fbshipit-source-id: aa7f2d0972e1c31d75339ac48478f34f6cfcfb3e
      fdf882de
  12. 08 2月, 2020 1 次提交
    • S
      Allow readahead when reading option files. (#6372) · 876c2dbf
      sdong 提交于
      Summary:
      Right, when reading from option files, no readahead is used and 8KB buffer is used. It might introduce high latency if the file system provide high latency and doesn't do readahead. Instead, introduce a readahead to the file. When calling inside DB, infer the value from options.log_readahead. Otherwise, a default 512KB readahead size is used.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6372
      
      Test Plan: Add --log_readahead_size in db_bench. Run it with several options and observe read size from option files using strace.
      
      Differential Revision: D19727739
      
      fbshipit-source-id: e6d8053b0a64259abc087f1f388b9cd66fa8a583
      876c2dbf
  13. 14 12月, 2019 1 次提交
    • A
      Introduce a new storage specific Env API (#5761) · afa2420c
      anand76 提交于
      Summary:
      The current Env API encompasses both storage/file operations, as well as OS related operations. Most of the APIs return a Status, which does not have enough metadata about an error, such as whether its retry-able or not, scope (i.e fault domain) of the error etc., that may be required in order to properly handle a storage error. The file APIs also do not provide enough control over the IO SLA, such as timeout, prioritization, hinting about placement and redundancy etc.
      
      This PR separates out the file/storage APIs from Env into a new FileSystem class. The APIs are updated to return an IOStatus with metadata about the error, as well as to take an IOOptions structure as input in order to allow more control over the IO.
      
      The user can set both ```options.env``` and ```options.file_system``` to specify that RocksDB should use the former for OS related operations and the latter for storage operations. Internally, a ```CompositeEnvWrapper``` has been introduced that inherits from ```Env``` and redirects individual methods to either an ```Env``` implementation or the ```FileSystem``` as appropriate. When options are sanitized during ```DB::Open```, ```options.env``` is replaced with a newly allocated ```CompositeEnvWrapper``` instance if both env and file_system have been specified. This way, the rest of the RocksDB code can continue to function as before.
      
      This PR also ports PosixEnv to the new API by splitting it into two - PosixEnv and PosixFileSystem. PosixEnv is defined as a sub-class of CompositeEnvWrapper, and threading/time functions are overridden with Posix specific implementations in order to avoid an extra level of indirection.
      
      The ```CompositeEnvWrapper``` translates ```IOStatus``` return code to ```Status```, and sets the severity to ```kSoftError``` if the io_status is retryable. The error handling code in RocksDB can then recover the DB automatically.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5761
      
      Differential Revision: D18868376
      
      Pulled By: anand1976
      
      fbshipit-source-id: 39efe18a162ea746fabac6360ff529baba48486f
      afa2420c
  14. 21 9月, 2019 1 次提交
  15. 17 9月, 2019 1 次提交
    • S
      Divide file_reader_writer.h and .cc (#5803) · b931f84e
      sdong 提交于
      Summary:
      file_reader_writer.h and .cc contain several files and helper function, and it's hard to navigate. Separate it to multiple files and put them under file/
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5803
      
      Test Plan: Build whole project using make and cmake.
      
      Differential Revision: D17374550
      
      fbshipit-source-id: 10efca907721e7a78ed25bbf74dc5410dea05987
      b931f84e
  16. 19 6月, 2019 1 次提交
  17. 07 6月, 2019 1 次提交
  18. 04 6月, 2019 1 次提交
  19. 01 6月, 2019 1 次提交
  20. 31 5月, 2019 1 次提交
  21. 15 3月, 2019 1 次提交
    • Z
      Add the -try_process_corrupted_trace option to trace_analyzer (#5067) · dcde292c
      Zhichao Cao 提交于
      Summary:
      In the current trace_analyzer implementation, once the trace file has corrupted content, which can be caused by unexpected tracing operations or other reasons, trace_analyzer will print the error and stop analyzing.
      
      By adding the -try_process_corrupted_trace option, user can try to process the corrupted trace file and get the analyzing results of the trace records from the beginning to the the first corrupted point in the trace file. Analyzing might fail even this option is enabled.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5067
      
      Differential Revision: D14433037
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: d095233ba371726869af0def0cdee23b69896831
      dcde292c
  22. 13 11月, 2018 1 次提交
    • Z
      Add unique key number changing statistics to Trace_analyzer (#4646) · d761857d
      Zhichao Cao 提交于
      Summary:
      Changes:
      1. in current version, key size distribution is printed out as the result. In this change, the result will be output to a file to make further analyze easier
      2. To understand how the unique keys are accessed over time, the total unique key number of each CF of each query type in each second over time is output to a file. In this way, user could know when the unique keys are accessed frequently or accessed rarely.
      3. output the total QPS of each CF to a file
      4. Add the print result of total queries of each CF of each query type.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4646
      
      Differential Revision: D12968156
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 6c411c7ec47c7843a70929136efd71a150db0e4c
      d761857d
  23. 11 10月, 2018 1 次提交
  24. 31 8月, 2018 1 次提交
    • Z
      Rename DecodeCFAndKey to resolve naming conflict in unity test (#4323) · 1cf17ba5
      Zhongyi Xie 提交于
      Summary:
      Currently unity-test is failing because both trace_replay.cc and trace_analyzer_tool.cc defined `DecodeCFAndKey` under anonymous namespace. It is supposed to be fine except unity test will dump all source files together and now we have a conflict.
      Another issue with trace_analyzer_tool.cc is that it is using some utility functions from ldb_cmd which is not included in Makefile for unity_test, I chose to update TESTHARNESS to include LIBOBJECTS. Feel free to comment if there is a less intrusive way to solve this.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4323
      
      Differential Revision: D9599170
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 38765b11f8e7de92b43c63bdcf43ea914abdc029
      1cf17ba5
  25. 24 8月, 2018 2 次提交
  26. 15 8月, 2018 1 次提交
  27. 14 8月, 2018 1 次提交
    • Z
      RocksDB Trace Analyzer (#4091) · 999d955e
      Zhichao Cao 提交于
      Summary:
      A framework of trace analyzing for RocksDB
      
      After collecting the trace by using the tool of [PR #3837](https://github.com/facebook/rocksdb/pull/3837). User can use the Trace Analyzer to interpret, analyze, and characterize the collected workload.
      **Input:**
      1. trace file
      2. Whole keys space file
      
      **Statistics:**
      1. Access count of each operation (Get, Put, Delete, SingleDelete, DeleteRange, Merge) in each column family.
      2. Key hotness (access count) of each one
      3. Key space separation based on given prefix
      4. Key size distribution
      5. Value size distribution if appliable
      6. Top K accessed keys
      7. QPS statistics including the average QPS and peak QPS
      8. Top K accessed prefix
      9. The query correlation analyzing, output the number of X after Y and the corresponding average time
          intervals
      
      **Output:**
      1. key access heat map (either in the accessed key space or whole key space)
      2. trace sequence file (interpret the raw trace file to line base text file for future use)
      3. Time serial (The key space ID and its access time)
      4. Key access count distritbution
      5. Key size distribution
      6. Value size distribution (in each intervals)
      7. whole key space separation by the prefix
      8. Accessed key space separation by the prefix
      9. QPS of each operation and each column family
      10. Top K QPS and their accessed prefix range
      
      **Test:**
      1. Added the unit test of analyzing Get, Put, Delete, SingleDelete, DeleteRange, Merge
      2. Generated the trace and analyze the trace
      
      **Implemented but not tested (due to the limitation of trace_replay):**
      1. Analyzing Iterator, supporting Seek() and SeekForPrev() analyzing
      2. Analyzing the number of Key found by Get
      
      **Future Work:**
      1.  Support execution time analyzing of each requests
      2.  Support cache hit situation and block read situation of Get
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4091
      
      Differential Revision: D9256157
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: f0ceacb7eedbc43a3eee6e85b76087d7832a8fe6
      999d955e