1. 26 3月, 2020 1 次提交
  2. 25 3月, 2020 1 次提交
    • Y
      Update a few scripts to be python3 compatible (#6525) · ccf76764
      Yanqin Jin 提交于
      Summary:
      There are a few scripts with python3 compatibility issues that were not
      detected by automated tool before. Update them now.
      
      Test Plan (devserver):
      python2 tools/ldb_test.py
      python3 tools/ldb_test.py
      
      python2 tools/write_stress_runner.py --runtime_sec=30
      python3 tools/write_stress_runner.py --runtime_sec=30
      
      python2 tools/db_crashtest.py --simple --interval=2 --duration=10 blackbox
      python3 tools/db_crashtest.py --simple --interval=2 --duration=10 blackbox
      
      python2 tools/db_crashtest.py --simple --duration=10 --random_kill_odd=1000 --ops_per_thread=1000 whitebox
      python3 tools/db_crashtest.py --simple --duration=10 --random_kill_odd=1000 --ops_per_thread=1000 whitebox
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6525
      
      Reviewed By: cheng-chang
      
      Differential Revision: D20627820
      
      Pulled By: riversand963
      
      fbshipit-source-id: 4b25a7bd4d001c7f868be8b640ef876523be6ca3
      ccf76764
  3. 24 3月, 2020 1 次提交
    • A
      Simplify migration to FileSystem API (#6552) · a9d168cf
      anand76 提交于
      Summary:
      The current Env/FileSystem API separation has a couple of issues -
      1. It requires the user to specify 2 options - ```Options::env``` and ```Options::file_system``` - which means they have to make code changes to benefit from the new APIs. Furthermore, there is a risk of accessing the same APIs in two different ways, through Env in the old way and through FileSystem in the new way. The two may not always match, for example, if env is ```PosixEnv``` and FileSystem is a custom implementation. Any stray RocksDB calls to env will use the ```PosixEnv``` implementation rather than the file_system implementation.
      2. There needs to be a simple way for the FileSystem developer to instantiate an Env for backward compatibility purposes.
      
      This PR solves the above issues and simplifies the migration in the following ways -
      1. Embed a shared_ptr to the ```FileSystem``` in the ```Env```, and remove ```Options::file_system``` as a configurable option. This way, no code changes will be required in application code to benefit from the new API. The default Env constructor uses a ```LegacyFileSystemWrapper``` as the embedded ```FileSystem```.
      1a. - This also makes it more robust by ensuring that even if RocksDB
        has some stray calls to Env APIs rather than FileSystem, they will go
        through the same object and thus there is no risk of getting out of
        sync.
      2. Provide a ```NewCompositeEnv()``` API that can be used to construct a
      PosixEnv with a custom FileSystem implementation. This eliminates an
      indirection to call Env APIs, and relieves the FileSystem developer of
      the burden of having to implement wrappers for the Env APIs.
      3. Add a couple of missing FileSystem APIs - ```SanitizeEnvOptions()``` and
      ```NewLogger()```
      
      Tests:
      1. New unit tests
      2. make check and make asan_check
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6552
      
      Reviewed By: riversand963
      
      Differential Revision: D20592038
      
      Pulled By: anand1976
      
      fbshipit-source-id: c3801ad4153f96d21d5a3ae26c92ba454d1bf1f7
      a9d168cf
  4. 19 3月, 2020 2 次提交
    • L
      Remove GetSortedWalFiles/GetCurrentWalFile from the crash test (#6491) · 217ce200
      Levi Tamasi 提交于
      Summary:
      Currently, `db_stress` tests a randomly picked one of `GetLiveFiles`,
      `GetSortedWalFiles`, and `GetCurrentWalFile` with a 1/N chance when the
      command line parameter `get_live_files_and_wal_files_one_in` is specified.
      The problem is that `GetSortedWalFiles` and `GetCurrentWalFile` are unreliable
      in the sense that they can return errors if another thread removes a WAL file
      while they are executing (which is a perfectly plausible and legitimate scenario).
      The patch splits this command line parameter into three (one for each API),
      and changes the crash test script so that only `GetLiveFiles` is tested during
      our continuous crash test runs.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6491
      
      Test Plan:
      ```
      make check
      python tools/db_crashtest.py whitebox
      ```
      
      Reviewed By: siying
      
      Differential Revision: D20312200
      
      Pulled By: ltamasi
      
      fbshipit-source-id: e7c3481eddfe3bd3d5349476e34abc9eee5b7dc8
      217ce200
    • S
      cmake: add option WITH_CORE_TOOLS to exclude tools except ldb and sst_dump (#6506) · 8ad4b32c
      sdong 提交于
      Summary:
      ldb and sst_dump are most important tools and they don't dependend on gflags. In cmake, we don't have an way to only build these two tools and exclude other tools. This is inconvenient if the environment has a problem with gflags. Add such an option WITH_CORE_TOOLS.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6506
      
      Test Plan: cmake and build with WITH_TOOLS and without.
      
      Differential Revision: D20473029
      
      fbshipit-source-id: 3d730fd14bbae6eeeae7f9cc9aec50a4e488ad72
      8ad4b32c
  5. 17 3月, 2020 1 次提交
    • S
      Fix an error in db_bench with gcc 4.8 (#6537) · 488b1e67
      sdong 提交于
      Summary:
      I start to see following failures:
      
      tools/db_bench_tool.cc: In constructor ‘rocksdb::NormalDistribution::NormalDistribution(unsigned int, unsigned int)’:
      tools/db_bench_tool.cc:1528:58: error: declaration of ‘max’ shadows a member of 'this' [-Werror=shadow]
         NormalDistribution(unsigned int min, unsigned int max) :
                                                                ^
      tools/db_bench_tool.cc:1528:58: error: declaration of ‘min’ shadows a member of 'this' [-Werror=shadow]
      tools/db_bench_tool.cc: In constructor ‘rocksdb::UniformDistribution::UniformDistribution(unsigned int, unsigned int)’:
      tools/db_bench_tool.cc:1546:59: error: declaration of ‘max’ shadows a member of 'this' [-Werror=shadow]
         UniformDistribution(unsigned int min, unsigned int max) :
                                                                 ^
      tools/db_bench_tool.cc:1546:59: error: declaration of ‘min’ shadows a member of 'this' [-Werror=shadow]
      
      when I build from GCC 4.8. Rename those variables to fix the problem.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6537
      
      Test Plan: make all with the compiler that used to show the failure.
      
      Differential Revision: D20448741
      
      fbshipit-source-id: 18bcf012dbe020f22f79038a9b08f447befa2574
      488b1e67
  6. 13 3月, 2020 1 次提交
  7. 12 3月, 2020 1 次提交
  8. 07 3月, 2020 1 次提交
    • Y
      Iterator with timestamp (#6255) · d93812c9
      Yanqin Jin 提交于
      Summary:
      Preliminary support for iterator with user timestamp. Current implementation does not consider merge operator and reverse iterator. Auto compaction is also disabled in unit tests.
      
      Create an iterator with timestamp.
      ```
      ...
      read_opts.timestamp = &ts;
      auto* iter = db->NewIterator(read_opts);
      // target is key without timestamp.
      for (iter->Seek(target); iter->Valid(); iter->Next()) {}
      for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {}
      delete iter;
      read_opts.timestamp = &ts1;
      // lower_bound and upper_bound are without timestamp.
      read_opts.iterate_lower_bound = &lower_bound;
      read_opts.iterate_upper_bound = &upper_bound;
      auto* iter1 = db->NewIterator(read_opts);
      // Do Seek or SeekToFirst()
      delete iter1;
      ```
      
      Test plan (dev server)
      ```
      $make check
      ```
      
      Simple benchmarking (dev server)
      1. The overhead introduced by this PR even when timestamp is disabled.
      key size: 16 bytes
      value size: 100 bytes
      Entries: 1000000
      Data reside in main memory, and try to stress iterator.
      Repeated three times on master and this PR.
      - Seek without next
      ```
      ./db_bench -db=/dev/shm/rocksdbtest-1000 -benchmarks=fillseq,seekrandom -enable_pipelined_write=false -disable_wal=true -format_version=3
      ```
      master: 159047.0 ops/sec
      this PR: 158922.3 ops/sec (2% drop in throughput)
      - Seek and next 10 times
      ```
      ./db_bench -db=/dev/shm/rocksdbtest-1000 -benchmarks=fillseq,seekrandom -enable_pipelined_write=false -disable_wal=true -format_version=3 -seek_nexts=10
      ```
      master: 109539.3 ops/sec
      this PR: 107519.7 ops/sec (2% drop in throughput)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6255
      
      Differential Revision: D19438227
      
      Pulled By: riversand963
      
      fbshipit-source-id: b66b4979486f8474619f4aa6bdd88598870b0746
      d93812c9
  9. 03 3月, 2020 2 次提交
  10. 29 2月, 2020 1 次提交
  11. 21 2月, 2020 2 次提交
  12. 20 2月, 2020 1 次提交
  13. 14 2月, 2020 1 次提交
  14. 13 2月, 2020 1 次提交
  15. 11 2月, 2020 1 次提交
    • Z
      Checksum for each SST file and stores in MANIFEST (#6216) · 4369f2c7
      Zhichao Cao 提交于
      Summary:
      In the current code base, RocksDB generate the checksum for each block and verify the checksum at usage. Current PR enable SST file checksum. After a SST file is generated by Flush or Compaction, RocksDB generate the SST file checksum and store the checksum value and checksum method name in the vs_info and MANIFEST as part for the FileMetadata.
      
      Added the enable_sst_file_checksum to Options to enable or disable file checksum. Added sst_file_checksum to Options such that user can plugin their own SST file checksum calculate method via overriding the SstFileChecksum class. The checksum information inlcuding uint32_t checksum value and a checksum name (string).  A new tool is added to LDB such that user can dump out a list of file checksum information from MANIFEST. If user enables the file checksum but does not provide the sst_file_checksum instance, RocksDB will use the default crc32checksum implemented in table/sst_file_checksum_crc32c.h
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6216
      
      Test Plan: Added the testing case in table_test and ldb_cmd_test to verify checksum is correct in different level. Pass make asan_check.
      
      Differential Revision: D19171461
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: b2e53479eefc5bb0437189eaa1941670e5ba8b87
      4369f2c7
  16. 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
  17. 06 2月, 2020 1 次提交
    • S
      Remove include math.h (#6373) · 24c9dce8
      sdong 提交于
      Summary:
      We see some odd errors complaining math. However, it doesn't seem that it is needed to be included. Remove the include of math.h. Just removing it from db_bench doesn't seem to break anything. Replacing sqrt from std::sqrt seems to work for histogram.cc
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6373
      
      Test Plan: Watch Travis and appveyor to run.
      
      Differential Revision: D19730068
      
      fbshipit-source-id: d3ad41defcdd9f51c2da1a3673fb258f5dfacf47
      24c9dce8
  18. 24 1月, 2020 1 次提交
  19. 23 1月, 2020 1 次提交
  20. 22 1月, 2020 1 次提交
    • S
      crash_test to enable block-based table hash index (#6310) · 8e309b35
      sdong 提交于
      Summary:
      Block-based table has index has been disabled in crash test due to bugs. We fixed a bug and re-enable it.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6310
      
      Test Plan: Finish one round of "crash_test_with_atomic_flush" test successfully while exclusively running has index. Another run also ran for several hours without failure.
      
      Differential Revision: D19455856
      
      fbshipit-source-id: 1192752d2c1e81ed7e5c5c7a9481c841582d5274
      8e309b35
  21. 17 1月, 2020 1 次提交
    • S
      Fix bug which causes crash_test to always run on sync mode (#6304) · 6b64aed4
      sdong 提交于
      Summary:
      A previous change meant to make db_stress to run on sync=1 mode for 1/20 of the time in crash_test, but a bug caused to to always run on sync=1 mode. Fix it.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6304
      
      Test Plan: Start and kill "python -u tools/db_crashtest.py --simple whitebox" multiple times and observe that most times sync=0 is used while some times sync=1 is used.
      
      Differential Revision: D19433000
      
      fbshipit-source-id: 7a0adba39b17a1b3acbbd791bb0cdb743b91fa95
      6b64aed4
  22. 10 1月, 2020 1 次提交
  23. 31 12月, 2019 1 次提交
  24. 24 12月, 2019 1 次提交
  25. 21 12月, 2019 4 次提交
    • A
      Generate variable length keys in db_stress (#6165) · 3160edfd
      anand76 提交于
      Summary:
      Currently, db_stress generates fixed length keys of 8 bytes. This patch adds the ability to generate variable length keys. Most of the db_stress code continues to work with a numeric key randomly generated, and the numeric key also acts as an index into the values_ array. The numeric key is mapped to a variable length string key in a deterministic way. Furthermore, the ordering is preserved.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6165
      
      Test Plan: run make crash_test
      
      Differential Revision: D19204646
      
      Pulled By: anand1976
      
      fbshipit-source-id: d2d46a96615b4832a8be2a981f5913905f0e1ca7
      3160edfd
    • S
      crash_test to cover bottommost compression and some other changes (#6215) · 338c149b
      sdong 提交于
      Summary:
      Several improvements to crash_test/stress_test:
      (1) Stress_test to support an parameter of bottommost compression
      (2) Rename those FLAGS_* variables that are not gflags to avoid confusion
      (3) Crash_test to randomly generate compression type for bottommost compression with half the chance.
      (4) Stress_test to sanitize unsupported compression type to snappy, so that crash_test to cover all possible compression types and people don't need to worry about they don't support all comrpession types in their environment.
      (5) In crash_test, when generating db_stress command, sort arguments in alphabeta order, so that it is easier to find value for a specific argument.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6215
      
      Test Plan: Run "make crash_test" for a while and see the botommost option shown in LOG files.
      
      Differential Revision: D19171255
      
      fbshipit-source-id: d7001e246c4ff9ee5760776eea0be97738650735
      338c149b
    • Z
      db_stress: Added the verification for GetLiveFiles, GetSortedWalFiles and GetCurrentWalFile (#6224) · f89dea4f
      Zhichao Cao 提交于
      Summary:
      Add the verification in operateDB to verify GetLiveFiles, GetSortedWalFiles and GetCurrentWalFile. The test will be called every 1 out of N, N is decided by get_live_files_and_wal_files_one_i, whose default is 1000000.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6224
      
      Test Plan: pass db_stress default run.
      
      Differential Revision: D19183358
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 20073cf72ede77a3e0d3cf5f28304f1f605d2b1a
      f89dea4f
    • Y
      Add more verification to db_stress (#6173) · 670a916d
      Yanqin Jin 提交于
      Summary:
      Currently, db_stress performs verification by calling `VerifyDb()` at the end of test and optionally before tests start. In case of corruption or incorrect result, it will be too late. This PR adds more verification in two ways.
      1. For cf consistency test, each test thread takes a snapshot and verifies every N ops. N is configurable via `-verify_db_one_in`. This option is not supported in other stress tests.
      2. For cf consistency test, we use another background thread in which a secondary instance periodically tails the primary (interval is configurable). We verify the secondary. Once an error is detected, we terminate the test and report. This does not affect other stress tests.
      
      Test plan (devserver)
      ```
      $./db_stress -test_cf_consistency -verify_db_one_in=0 -ops_per_thread=100000 -continuous_verification_interval=100
      $./db_stress -test_cf_consistency -verify_db_one_in=1000 -ops_per_thread=10000 -continuous_verification_interval=0
      $make crash_test
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6173
      
      Differential Revision: D19047367
      
      Pulled By: riversand963
      
      fbshipit-source-id: aeed584ad71f9310c111445f34975e5ab47a0615
      670a916d
  26. 20 12月, 2019 4 次提交
    • P
      Only search specific directories in Python check (#6225) · 1ba92b85
      Peter Dillinger 提交于
      Summary:
      The new Python syntax check could fail if external entities
      were cloned or symlinked to a subdir in a rocksdb git clone. (E.g.
      Facebook internal LITE build.) Only look for Python files in specific
      subdirs
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6225
      
      Test Plan: python tools/check_all_python.py (still 34 files checked)
      
      Reviewed By: gfosco
      
      Differential Revision: D19186110
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 1fefa54e36b32cd5d96d3d1a43e8a2a694c22ea5
      1ba92b85
    • M
      Revert "Add kHashSearch to stress tests (#6210)" (#6220) · 77d5ba78
      Maysam Yabandeh 提交于
      Summary:
      This reverts commit 54f9092b.
      It making our daily stress tests fail. Revert it until the issues are fixed.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6220
      
      Differential Revision: D19179881
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 99de0eaf776567fa81110b9ad2608234a16083ce
      77d5ba78
    • P
      Temporarily disable level_compaction_dynamic_level_bytes in crash test (#6217) · 9ff569bd
      Peter Dillinger 提交于
      Summary:
      We're seeing assertion violations like this in crash test:
      
      db_stress: table/block_based/block_based_table_reader.cc:4129: virtual uint64_t rocksdb::BlockBasedTable::ApproximateSize(const rocksdb::Slice&, const rocksdb::Slice&, rocksdb::TableReaderCaller): Assertion `end_offset >= start_offset' failed.***
      
      And ApproximateSize appears only to be called with the level_compaction_dynamic_level_bytes option.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6217
      
      Test Plan:
      temporarily put an assert(false) in ApproximateSize and
      briefly run 'make crash_test'
      
      Differential Revision: D19179174
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 506e6549aea0da19b363a1a6da04373c364d92e4
      9ff569bd
    • P
      Syntax check python files on testing (#6209) · 5b18729d
      Peter Dillinger 提交于
      Summary:
      Adds a python script to syntax check all python files in the
      repository and report any errors.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6209
      
      Test Plan:
      'make check' with and without seeded syntax errors. Also look
      for "No syntax errors in 34 .py files" on success, and in java_test CI output
      
      Differential Revision: D19166756
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 537df464b767260d66810b4cf4c9808a026c58a4
      5b18729d
  27. 19 12月, 2019 3 次提交
  28. 18 12月, 2019 2 次提交
    • A
      Add VerifyChecksum() to db_stress (#6203) · 2afea297
      anand76 提交于
      Summary:
      Add an option to db_stress, verify_checksum_one_in, to call DB::VerifyChecksum() once every N ops.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6203
      
      Differential Revision: D19145753
      
      Pulled By: anand1976
      
      fbshipit-source-id: d09edf21f309ad53aa40dd25b7a563d50665fd8b
      2afea297
    • S
      crash_test: two fixes (#6200) · 9f250dd8
      sdong 提交于
      Summary:
      Fix two crash test issues:
      1. sync mode should not run with disable_wal=true
      2. disable "compaction_readahead_size" for now. With it on, some block checksum verification failure will happen in compaction paths. Not sure why, but disable it for now to keep the test clean.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6200
      
      Test Plan: Run "make crash_test" and "make crash_test_with_atomic_flush" and see it runs way longer than before the fix without failing.
      
      Differential Revision: D19143493
      
      fbshipit-source-id: 438fad52fbda60aafd142e1b65578addbe7d72b1
      9f250dd8