1. 08 7月, 2020 3 次提交
    • P
      Replace large 'rm' with 'find' (#7095) · 4202c48f
      Peter Dillinger 提交于
      Summary:
      On some platforms like MacOS, a second 'make check' can lead to
      /bin/rm: Argument list too long
      
      This is fixed by replacing with a 'find'. Also, using '-f' for more rm calls
      to avoid prompt.
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7095
      
      Test Plan: 'make check' on Linux and MacOS
      
      Reviewed By: riversand963
      
      Differential Revision: D22415808
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 0fd1ebae13739c9d81f9e813e99b062715604d6b
      4202c48f
    • P
      Fix build of db_stress with LIB_MODE=shared (#7098) · 787bf79f
      Peter Dillinger 提交于
      Summary:
      by tracking and linking against runtime dependent libraries in
      Makefile
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7098
      
      Test Plan: look for fix in CircleCI
      
      Reviewed By: riversand963
      
      Differential Revision: D22420860
      
      Pulled By: pdillinger
      
      fbshipit-source-id: d211d709214bf5306db68e43b7a2f18169281022
      787bf79f
    • P
      Major CircleCI/Linux fixes / tweaks / enhancements (#7078) · 92731b6b
      Peter Dillinger 提交于
      Summary:
      Primarily, this change adds a way to work around a bug limiting the effective output (and therefore debugability) of the Linux builds using parallel make. We would get
      make[1]: write error: stdout
      probably due to a kernel bug, apparently affecting both available ubuntu 16 machine images (maybe not affecting docker images, less horsepower). https://bugs.launchpad.net/ubuntu/+source/linux-signed/+bug/1814393
      
      Now in the CircleCI config, make output on Ubuntu is piped through a custom 'cat' that ignores EAGAIN errors, which seems to fix the problem.
      
      Significant other changes:
      * Add another linux build that combines
        * LIB_MODE=shared, to ensure this works with compile and unit test execution
        * Alternative rocksdb namespace, to ensure this works (not rely on Travis)
        * ASSERT_STATUS_CHECKED=1, but with building all unit tests and running those expected to pass with it
      * Run release build with and without gflags. (Was running only without, ignore large swaths of code in a normal release build! Two regressions in this build, only with gflags, in the last week not caught by CI!)
      * Use gflags with unity and LITE build, as typical case.
      
      Debugability improvements:
      * Use V=1 to show commands being executed (thanks to EAGAIN work-around)
      * Print kernel version and compiler versions as part of V=1 output from Makefile
      
      Cosmetic other changes:
      * Put more commands on one line, for less clutter in CircleCI output pages
      * Remove redundant "all" in "make all check" and put make command options before targets
      * Change some recursive "make clean" into dependency on "clean," toward minimizing unnecessary overhead (detect platform, build version, etc.) of extra recursive makes
      
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7078
      
      Reviewed By: siying
      
      Differential Revision: D22391647
      
      Pulled By: pdillinger
      
      fbshipit-source-id: d446fccf5a8c568b37dc8748621c8a5c546fe135
      92731b6b
  2. 07 7月, 2020 1 次提交
    • P
      More Makefile clean-up (#7066) · bd77e341
      Peter Dillinger 提交于
      Summary:
      (a) use STRESS_LIBRARY for db_stress and make sure
      STRESS_LIBRARY has other stress test dependencies (as in buck build)
      
      (b) fix rpath option to be accepted on MacOS. It still doesn't fully work
      for me e.g. to run a LIB_MODE=shared unit test binary from another
      directory, as it does on Linux, but the option is now accepted, and running
      unit tests from current directory works for me.
      
      Also adding LIB_MODE=shared to Travis. (Later TBD where best to fit in
      in CircleCI.)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7066
      
      Test Plan: manual
      
      Reviewed By: cheng-chang
      
      Differential Revision: D22364068
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 6fa98a222f89f808ee786474de1100d92c1adec3
      bd77e341
  3. 02 7月, 2020 1 次提交
  4. 01 7月, 2020 1 次提交
    • M
      Use Libraries in the RocksDB Makefile Build (#6660) · 80f71b58
      mrambacher 提交于
      Summary:
      Change the linking of tests/tools to be against a library rather than a list of objects.  This change substantially reduces the size of the objects produced.
      
      peterd clean repo size: 264M
      Before this change, with make all: 40G
      After this change, with make all: 28G
      With make LIB_MODE=shared all: 7.0G
      
      The list of TESTS was changed from being hard-coded to generated from the test sources variable.  Note that there are some test sources that are not built as tests (though the set of tests is identical to the previous version).
      
      Added OBJ_DIR option to Makefile to allow objects to be placed in an alternative location.  By default, OBJ_DIR is the same as before ("./").
      
      This change is a precursor to being able to build/run the tests/tools linked against static libraries.  Additionally, it should be possible to clean up and merge some of the rules for building tests and the like if so desired.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6660
      
      Reviewed By: riversand963
      
      Differential Revision: D22244463
      
      Pulled By: pdillinger
      
      fbshipit-source-id: db9c6341d81ed62c2270374f4ede02fb9604c754
      80f71b58
  5. 27 6月, 2020 1 次提交
    • S
      Add unity build to CircleCI (#7026) · f9817201
      sdong 提交于
      Summary:
      We are still keeping unity build working. So it's a good idea to add to a pre-commit CI.
      A latest GCC docker image just to get a little bit more coverage. Fix three small issues to make it pass.
      Also make unity_test to run db_basic_test rather than db_test to cut the test time. There is no point to run expensive tests here. It was set to run db_test before db_basic_test was separated out.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/7026
      
      Test Plan: watch tests to pass.
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D22223197
      
      fbshipit-source-id: baa3b6cbb623bf359829b63ce35715c75bcb0ed4
      f9817201
  6. 20 6月, 2020 1 次提交
  7. 19 6月, 2020 1 次提交
    • A
      Add IOTracer reader, writer classes for reading/writing IO operations in a binary file (#6958) · 552fd765
      Akanksha Mahajan 提交于
      Summary:
      1. As part of IOTracing project, Add a class IOTracer,
      IOTraceReader and IOTracerWriter that writes the file operations
      information in a binary file. IOTrace Record contains record information
      and right now it contains access_timestamp, file_operation, file_name,
      io_status, len, offset and later other options will be added when file
      system APIs will be call IOTracer.
      
      2. Add few unit test cases that verify that reading and writing to a IO
      Trace file is working properly and before start trace and after ending
      trace nothing is added to the binary file.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6958
      
      Test Plan:
      1. make check -j64
                       2. New testcases for IOTracer.
      
      Reviewed By: anand1976
      
      Differential Revision: D21943375
      
      Pulled By: akankshamahajan15
      
      fbshipit-source-id: 3532204e2a3eab0104bf411ab142e3fdd4fbce54
      552fd765
  8. 13 6月, 2020 1 次提交
    • Y
      Add stress test for best-efforts recovery (#6819) · 15d9f28d
      Yanqin Jin 提交于
      Summary:
      Add crash test for the case of best-efforts recovery.
      After a certain amount of time, we kill the db_stress process, randomly delete some certain table files and restart db_stress. Given the randomness of file deletion, it is difficult to verify against a reference for data correctness. Therefore, we just check that the db can restart successfully.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6819
      
      Test Plan:
      ```
      ./db_stress -best_efforts_recovery=true -disable_wal=1 -reopen=0
      ./db_stress -best_efforts_recovery=true -disable_wal=0 -skip_verifydb=1 -verify_db_one_in=0 -continuous_verification_interval=0
      make crash_test_with_best_efforts_recovery
      ```
      
      Reviewed By: anand1976
      
      Differential Revision: D21436753
      
      Pulled By: riversand963
      
      fbshipit-source-id: 0b3605c922a16c37ed17d5ab6682ca4240e47926
      15d9f28d
  9. 09 6月, 2020 1 次提交
    • S
      Introduce some Linux build to CircleCI (#6937) · 6a8ddd37
      sdong 提交于
      Summary:
      Moving towards the long term goal of moving most CI build to CircleCI when possible, add some Linux tests in CircleCI. This is not all what we can include to CircleCI. For example, Java builds are not includ
      ed.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6937
      
      Test Plan: Watch CI build results.
      
      Reviewed By: pdillinger
      
      Differential Revision: D21941605
      
      fbshipit-source-id: db6aead3c45f523386d4fb30d224cfde573cccad
      6a8ddd37
  10. 06 6月, 2020 1 次提交
    • C
      Make DestroyDir destroy directories recursively (#6934) · 1bee0fca
      Cheng Chang 提交于
      Summary:
      Currently, `DeleteDir` only deletes the directory if there are no other directories under the target dir. This PR makes it delete directories recursively.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6934
      
      Test Plan:
      Added a new unit test in testutil_test.cc.
      `make testutil_test`
      
      Reviewed By: zhichao-cao
      
      Differential Revision: D21884211
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: 0b9a48a200f494ee007aef5d1763b4aa331f8b5a
      1bee0fca
  11. 04 6月, 2020 2 次提交
  12. 02 6月, 2020 1 次提交
  13. 30 5月, 2020 1 次提交
    • P
      Allow missing "unversioned" python, as in CentOS 8 (#6883) · 0c56fc4d
      Peter Dillinger 提交于
      Summary:
      RocksDB Makefile was assuming existence of 'python' command,
      which is not present in CentOS 8. We avoid using 'python' if 'python3' is available.
      
      Also added fancy logic to format-diff.sh to make clang-format-diff.py for Python2 work even with Python3 only (as some CentOS 8 FB machines come equipped)
      
      Also, now use just 'python3' for PYTHON if not found so that an informative
      "command not found" error will result rather than something weird.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6883
      
      Test Plan: manually tried some variants, 'make check' on a fresh CentOS 8 machine without 'python' executable or Python2 but with clang-format-diff.py for Python2.
      
      Reviewed By: gg814
      
      Differential Revision: D21767029
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 54761b376b140a3922407bdc462f3572f461d0e9
      0c56fc4d
  14. 23 5月, 2020 2 次提交
    • P
      Misc things for ASSERT_STATUS_CHECKED, also gcc 4.8.5 (#6871) · 803a517b
      Peter Dillinger 提交于
      Summary:
      * Print stack trace on status checked failure
      * Make folly_synchronization_distributed_mutex_test a parallel test
      * Disable ldb_test.py and rocksdb_dump_test.sh with
        ASSERT_STATUS_CHECKED (broken)
      * Fix shadow warning in random_access_file_reader.h reported by gcc
        4.8.5 (ROCKSDB_NO_FBCODE), also https://github.com/facebook/rocksdb/issues/6866
      * Work around compiler bug on max_align_t for gcc < 4.9
      * Remove an apparently wrong comment in status.h
      * Use check_some in Travis config (for proper diagnostic output)
      * Fix ignored Status in loop in options_helper.cc
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6871
      
      Test Plan: manual, CI
      
      Reviewed By: ajkr
      
      Differential Revision: D21706619
      
      Pulled By: pdillinger
      
      fbshipit-source-id: daf6364173d6689904eb394461a69a11f5bee2cb
      803a517b
    • P
      Fix/expand ASSERT_STATUS_CHECKED build, add to Travis (#6870) · 35a25a3f
      Peter Dillinger 提交于
      Summary:
      Fixed some option handling code that recently broke the
      ASSERT_STATUS_CHECKED build for options_test.
      
      Added all other existing tests that pass under ASSERT_STATUS_CHECKED to
      the whitelist.
      
      Added a Travis configuration to run all whitelisted tests with
      ASSERT_STATUS_CHECKED. (Someday we might enable this check by default in
      debug builds.)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6870
      
      Test Plan: ASSERT_STATUS_CHECKED=1 make check, Travis
      
      Reviewed By: ajkr
      
      Differential Revision: D21704374
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 15daef98136a19d7a6843fa0c9ec08738c2ac693
      35a25a3f
  15. 21 5月, 2020 1 次提交
  16. 20 5月, 2020 1 次提交
  17. 15 5月, 2020 1 次提交
    • C
      Enable IO Uring in MultiGet in direct IO mode (#6815) · 91b75532
      Cheng Chang 提交于
      Summary:
      Currently, in direct IO mode, `MultiGet` retrieves the data blocks one by one instead of in parallel, see `BlockBasedTable::RetrieveMultipleBlocks`.
      
      Since direct IO is supported in `RandomAccessFileReader::MultiRead` in https://github.com/facebook/rocksdb/pull/6446, this PR applies `MultiRead` to `MultiGet` so that the data blocks can be retrieved in parallel.
      
      Also, in direct IO mode and when data blocks are compressed and need to uncompressed, this PR only allocates one continuous aligned buffer to hold the data blocks, and then directly uncompress the blocks to insert into block cache, there is no longer intermediate copies to scratch buffers.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6815
      
      Test Plan:
      1. added a new unit test `BlockBasedTableReaderTest::MultiGet`.
      2. existing unit tests and stress tests  contain tests against `MultiGet` in direct IO mode.
      
      Reviewed By: anand1976
      
      Differential Revision: D21426347
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: b8446ae0e74152444ef9111e97f8e402ac31b24f
      91b75532
  18. 09 5月, 2020 1 次提交
    • A
      prototype status check enforcement (#6798) · 1c846604
      Andrew Kryczka 提交于
      Summary:
      Tried making Status object enforce that it is checked in some way. In cases it is not checked, `PermitUncheckedError()` must be called explicitly.
      
      Added a way to run tests (`ASSERT_STATUS_CHECKED=1 make -j48 check`) on a
      whitelist. The effort appears significant to get each test to pass with
      this assertion, so I only fixed up enough to get one test (`options_test`)
      working and added it to the whitelist.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6798
      
      Reviewed By: pdillinger
      
      Differential Revision: D21377404
      
      Pulled By: ajkr
      
      fbshipit-source-id: 73236f9c8df38f01cf24ecac4a6d1661b72d077e
      1c846604
  19. 01 5月, 2020 1 次提交
    • Y
      Add Github Action for some basic sanity test of PR (#6761) · 6acbbbf9
      Yanqin Jin 提交于
      Summary:
      Add Github Action to perform some basic sanity check for PR, inclding the
      following.
      1) Buck TARGETS file.
      On the one hand, The TARGETS file is used for internal buck, and we do not
      manually update it. On the other hand, we need to run the buckifier scripts to
      update TARGETS whenever new files are added, etc. With this Github Action, we
      make sure that every PR does not forget this step. The GH Action uses
      a Makefile target called check-buck-targets. Users can manually run `make
      check-buck-targets` on local machine.
      
      2) Code format
      We use clang-format-diff.py to format our code. The GH Action in this PR makes
      sure this step is not skipped. The checking script build_tools/format-diff.sh assumes that `clang-format-diff.py` is executable.
      On host running GH Action, it is difficult to download `clang-format-diff.py` and make it
      executable. Therefore, we modified build_tools/format-diff.sh to handle the case in which there is a non-executable clang-format-diff.py file in the top-level rocksdb repo directory.
      
      Test Plan (Github and devserver):
      Watch for Github Action result in the `Checks` tab.
      On dev server
      ```
      make check-format
      make check-buck-targets
      make check
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6761
      
      Test Plan: Watch for Github Action result in the `Checks` tab.
      
      Reviewed By: pdillinger
      
      Differential Revision: D21260209
      
      Pulled By: riversand963
      
      fbshipit-source-id: c646e2f37c6faf9f0614b68aa0efc818cff96787
      6acbbbf9
  20. 28 4月, 2020 1 次提交
    • P
      Understand common build variables passed as make variables (#6740) · 791e5714
      Peter Dillinger 提交于
      Summary:
      Some common build variables like USE_CLANG and
      COMPILE_WITH_UBSAN did not work if specified as make variables, as in
      `make USE_CLANG=1 check` etc. rather than (in theory less hygienic)
      `USE_CLANG=1 make check`. This patches Makefile to export some commonly
      used ones to build_detect_platform so that they work. (I'm skeptical of
      a broad `export` in Makefile because it's hard to predict how random
      make variables might affect various invoked tools.)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6740
      
      Test Plan: manual / CI
      
      Reviewed By: siying
      
      Differential Revision: D21229011
      
      Pulled By: pdillinger
      
      fbshipit-source-id: b00c69b23eb2a13105bc8d860ce2d1e61ac5a355
      791e5714
  21. 25 4月, 2020 1 次提交
    • C
      Reduce memory copies when fetching and uncompressing blocks from SST files (#6689) · 40497a87
      Cheng Chang 提交于
      Summary:
      In https://github.com/facebook/rocksdb/pull/6455, we modified the interface of `RandomAccessFileReader::Read` to be able to get rid of memcpy in direct IO mode.
      This PR applies the new interface to `BlockFetcher` when reading blocks from SST files in direct IO mode.
      
      Without this PR, in direct IO mode, when fetching and uncompressing compressed blocks, `BlockFetcher` will first copy the raw compressed block into `BlockFetcher::compressed_buf_` or `BlockFetcher::stack_buf_` inside `RandomAccessFileReader::Read` depending on the block size. then during uncompressing, it will copy the uncompressed block into `BlockFetcher::heap_buf_`.
      
      In this PR, we get rid of the first memcpy and directly uncompress the block from `direct_io_buf_` to `heap_buf_`.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6689
      
      Test Plan: A new unit test `block_fetcher_test` is added.
      
      Reviewed By: anand1976
      
      Differential Revision: D21006729
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: 2370b92c24075692423b81277415feb2aed5d980
      40497a87
  22. 17 4月, 2020 1 次提交
  23. 11 4月, 2020 2 次提交
    • A
      Fault injection in db_stress (#6538) · 5c19a441
      anand76 提交于
      Summary:
      This PR implements a fault injection mechanism for injecting errors in reads in db_stress. The FaultInjectionTestFS is used for this purpose. A thread local structure is used to track the errors, so that each db_stress thread can independently enable/disable error injection and verify observed errors against expected errors. This is initially enabled only for Get and MultiGet, but can be extended to iterator as well once its proven stable.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6538
      
      Test Plan:
      crash_test
      make check
      
      Reviewed By: riversand963
      
      Differential Revision: D20714347
      
      Pulled By: anand1976
      
      fbshipit-source-id: d7598321d4a2d72bda0ced57411a337a91d87dc7
      5c19a441
    • Y
      Compaction with timestamp: input boundaries (#6645) · 0c05624d
      Yanqin Jin 提交于
      Summary:
      Towards making compaction logic compatible with user timestamp.
      When computing boundaries and overlapping ranges for inputs of compaction, We need to compare SSTs by user key without timestamp.
      
      Test plan (devserver):
      ```
      make check
      ```
      Several individual tests:
      ```
      ./version_set_test --gtest_filter=VersionStorageInfoTimestampTest.GetOverlappingInputs
      ./db_with_timestamp_compaction_test
      ./db_with_timestamp_basic_test
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6645
      
      Reviewed By: ltamasi
      
      Differential Revision: D20960012
      
      Pulled By: riversand963
      
      fbshipit-source-id: ad377fa9eb481bf7a8a3e1824aaade48cdc653a4
      0c05624d
  24. 10 4月, 2020 1 次提交
    • L
      Provide an allocator for new memory type to be used with RocksDB block cache (#6214) · 66a95f0f
      Luca Giacchino 提交于
      Summary:
      New memory technologies are being developed by various hardware vendors (Intel DCPMM is one such technology currently available). These new memory types require different libraries for allocation and management (such as PMDK and memkind). The high capacities available make it possible to provision large caches (up to several TBs in size), beyond what is achievable with DRAM.
      The new allocator provided in this PR uses the memkind library to allocate memory on different media.
      
      **Performance**
      
      We tested the new allocator using db_bench.
      - For each test, we vary the size of the block cache (relative to the size of the uncompressed data in the database).
      - The database is filled sequentially. Throughput is then measured with a readrandom benchmark.
      - We use a uniform distribution as a worst-case scenario.
      
      The plot shows throughput (ops/s) relative to a configuration with no block cache and default allocator.
      For all tests, p99 latency is below 500 us.
      
      ![image](https://user-images.githubusercontent.com/26400080/71108594-42479100-2178-11ea-8231-8a775bbc92db.png)
      
      **Changes**
      
      - Add MemkindKmemAllocator
      - Add --use_cache_memkind_kmem_allocator db_bench option (to create an LRU block cache with the new allocator)
      - Add detection of memkind library with KMEM DAX support
      - Add test for MemkindKmemAllocator
      
      **Minimum Requirements**
      
      - kernel 5.3.12
      - ndctl v67 - https://github.com/pmem/ndctl
      - memkind v1.10.0 - https://github.com/memkind/memkind
      
      **Memory Configuration**
      
      The allocator uses the MEMKIND_DAX_KMEM memory kind. Follow the instructions on[ memkind’s GitHub page](https://github.com/memkind/memkind) to set up NVDIMM memory accordingly.
      
      Note on memory allocation with NVDIMM memory exposed as system memory.
      - The MemkindKmemAllocator will only allocate from NVDIMM memory (using memkind_malloc with MEMKIND_DAX_KMEM kind).
      - The default allocator is not restricted to RAM by default. Based on NUMA node latency, the kernel should allocate from local RAM preferentially, but it’s a kernel decision. numactl --preferred/--membind can be used to allocate preferentially/exclusively from the local RAM node.
      
      **Usage**
      
      When creating an LRU cache, pass a MemkindKmemAllocator object as argument.
      For example (replace capacity with the desired value in bytes):
      
      ```
      #include "rocksdb/cache.h"
      #include "memory/memkind_kmem_allocator.h"
      
      NewLRUCache(
          capacity /*size_t*/,
          6 /*cache_numshardbits*/,
          false /*strict_capacity_limit*/,
          false /*cache_high_pri_pool_ratio*/,
          std::make_shared<MemkindKmemAllocator>());
      ```
      
      Refer to [RocksDB’s block cache documentation](https://github.com/facebook/rocksdb/wiki/Block-Cache) to assign the LRU cache as block cache for a database.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6214
      
      Reviewed By: cheng-chang
      
      Differential Revision: D19292435
      
      fbshipit-source-id: 7202f47b769e7722b539c86c2ffd669f64d7b4e1
      66a95f0f
  25. 09 4月, 2020 1 次提交
    • C
      Add unit test for TransactionLockMgr (#6599) · d648a0e1
      Cheng Chang 提交于
      Summary:
      Although there are tests related to locking in transaction_test, this new test directly tests against TransactionLockMgr.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6599
      
      Test Plan: make transaction_lock_mgr_test && ./transaction_lock_mgr_test
      
      Reviewed By: lth
      
      Differential Revision: D20673749
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: 1fa4a13218e68d785f5a99924556751a8c5c0f31
      d648a0e1
  26. 08 4月, 2020 1 次提交
  27. 05 4月, 2020 1 次提交
    • P
      Add some timestamps in CI build+test output (#6643) · a67fb4c9
      Peter Dillinger 提交于
      Summary:
      When Travis times out, it's hard to determine whether
      the last executing thing took an excessively long time or the
      sum of all the work just exceeded the time limit. This
      change inserts some timestamps in the output that should
      make this easier to determine.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6643
      
      Test Plan: CI (Travis mostly)
      
      Reviewed By: anand1976
      
      Differential Revision: D20843901
      
      Pulled By: pdillinger
      
      fbshipit-source-id: e7aae5434b0c609931feddf238ce4355964488b7
      a67fb4c9
  28. 02 4月, 2020 1 次提交
    • Z
      Add pipelined & parallel compression optimization (#6262) · 03a781a9
      Ziyue Yang 提交于
      Summary:
      This PR adds support for pipelined & parallel compression optimization for `BlockBasedTableBuilder`. This optimization makes block building, block compression and block appending a pipeline, and uses multiple threads to accelerate block compression. Users can set `CompressionOptions::parallel_threads` greater than 1 to enable compression parallelism.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6262
      
      Reviewed By: ajkr
      
      Differential Revision: D20651306
      
      fbshipit-source-id: 62125590a9c15b6d9071def9dc72589c1696a4cb
      03a781a9
  29. 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
  30. 21 3月, 2020 1 次提交
    • C
      Support direct IO in RandomAccessFileReader::MultiRead (#6446) · 4fc21664
      Cheng Chang 提交于
      Summary:
      By supporting direct IO in RandomAccessFileReader::MultiRead, the benefits of parallel IO (IO uring) and direct IO can be combined.
      
      In direct IO mode, read requests are aligned and merged together before being issued to RandomAccessFile::MultiRead, so blocks in the original requests might share the same underlying buffer, the shared buffers are returned in `aligned_bufs`, which is a new parameter of the `MultiRead` API.
      
      For example, suppose alignment requirement for direct IO is 4KB, one request is (offset: 1KB, len: 1KB), another request is (offset: 3KB, len: 1KB), then since they all belong to page (offset: 0, len: 4KB), `MultiRead` only reads the page with direct IO into a buffer on heap, and returns 2 Slices referencing regions in that same buffer. See `random_access_file_reader_test.cc` for more examples.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6446
      
      Test Plan: Added a new test `random_access_file_reader_test.cc`.
      
      Reviewed By: anand1976
      
      Differential Revision: D20097518
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: ca48a8faf9c3af146465c102ef6b266a363e78d1
      4fc21664
  31. 14 3月, 2020 1 次提交
  32. 13 3月, 2020 2 次提交
    • A
      Force Java version on Travis CI (#6512) · 0772768d
      Adam Retter 提交于
      Summary:
      In the `.travis.yml` file the `jdk: openjdk7` element is ignored when `language: cpp`. So whatever version of the JDK that was installed in the Travis container was used - typically JDK 11.
      
      To ensure our RocksJava builds are working, we now instead install and use OpenJDK 8. Ideally we would use OpenJDK 7, as RocksJava supports Java 7, but many of the newer Travis containers don't support Java 7, so Java 8 is the next best thing.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6512
      
      Differential Revision: D20388296
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 8bbe6b59b70cfab7fe81ff63867d907fefdd2df1
      0772768d
    • L
      Move BlobDB related files under db/ to db/blob/ (#6519) · c15e85bd
      Levi Tamasi 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6519
      
      Test Plan:
      ```
      make all
      make check
      ```
      
      Differential Revision: D20400691
      
      Pulled By: ltamasi
      
      fbshipit-source-id: 20ef911cf1c2c92c7f71ef0b493f9be64f2eef94
      c15e85bd
  33. 12 3月, 2020 2 次提交
    • C
      Cache result of GetLogicalBufferSize in Linux (#6457) · 2d9efc9a
      Cheng Chang 提交于
      Summary:
      In Linux, when reopening DB with many SST files, profiling shows that 100% system cpu time spent for a couple of seconds for `GetLogicalBufferSize`. This slows down MyRocks' recovery time when site is down.
      
      This PR introduces two new APIs:
      1. `Env::RegisterDbPaths` and `Env::UnregisterDbPaths` lets `DB` tell the env when it starts or stops using its database directories . The `PosixFileSystem` takes this opportunity to set up a cache from database directories to the corresponding logical block sizes.
      2. `LogicalBlockSizeCache` is defined only for OS_LINUX to cache the logical block sizes.
      
      Other modifications:
      1. rename `logical buffer size` to `logical block size` to be consistent with Linux terms.
      2. declare `GetLogicalBlockSize` in `PosixHelper` to expose it to `PosixFileSystem`.
      3. change the functions `IOError` and `IOStatus` in `env/io_posix.h` to have external linkage since they are used in other translation units too.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6457
      
      Test Plan:
      1. A new unit test is added for `LogicalBlockSizeCache` in `env/io_posix_test.cc`.
      2. A new integration test is added for `DB` operations related to the cache in `db/db_logical_block_size_cache_test.cc`.
      
      `make check`
      
      Differential Revision: D20131243
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: 3077c50f8065c0bffb544d8f49fb10bba9408d04
      2d9efc9a
    • A
      Update to latest Snappy to fix compilation issue on latest MacOS XCode (#6496) · 65b60db9
      Adam Retter 提交于
      Summary:
      * **macOS version:** 10.15.2 (Catalina)
      * **XCode/Clang version:** Apple clang version 11.0.0 (clang-1100.0.33.16)
      
      Before this bugfix the error generated is:
      
      ```
      In file included from ./util/compression.h:23:
      ./snappy-1.1.7/snappy.h:76:59: error: unknown type name 'string'; did you mean 'std::string'?
        size_t Compress(const char* input, size_t input_length, string* output);
                                                                ^~~~~~
                                                                std::string
      /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iosfwd:211:65: note: 'std::string' declared here
      typedef basic_string<char, char_traits<char>, allocator<char> > string;
                                                                      ^
      In file included from db/builder.cc:10:
      In file included from ./db/builder.h:12:
      In file included from ./db/range_tombstone_fragmenter.h:15:
      In file included from ./db/pinned_iterators_manager.h:12:
      In file included from ./table/internal_iterator.h:13:
      In file included from ./table/format.h:25:
      In file included from ./options/cf_options.h:14:
      In file included from ./util/compression.h:23:
      ./snappy-1.1.7/snappy.h:85:19: error: unknown type name 'string'; did you mean 'std::string'?
                        string* uncompressed);
                        ^~~~~~
                        std::string
      /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iosfwd:211:65: note: 'std::string' declared here
      typedef basic_string<char, char_traits<char>, allocator<char> > string;
                                                                      ^
      2 errors generated.
      make: *** [jls/db/builder.o] Error 1
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6496
      
      Differential Revision: D20389254
      
      Pulled By: pdillinger
      
      fbshipit-source-id: 2864245c8d0dba7b2ab81294241a62f2adf02e20
      65b60db9