1. 20 5月, 2016 1 次提交
  2. 19 5月, 2016 1 次提交
    • O
      Move IO failure test to separate file · 3c69f77c
      omegaga 提交于
      Summary:
      This is a part of effort to reduce the size of db_test.cc. We move the following tests to a separate file `db_io_failure_test.cc`:
      
      * DropWrites
      * DropWritesFlush
      * NoSpaceCompactRange
      * NonWritableFileSystem
      * ManifestWriteError
      * PutFailsParanoid
      
      Test Plan: Run `make check` to see if the tests are working properly.
      
      Reviewers: sdong, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58341
      3c69f77c
  3. 18 5月, 2016 1 次提交
    • K
      Persistent Read Cache (Part 2) Data structure for building persistent read cache index · 1f0142ce
      krad 提交于
      Summary:
      We expect the persistent read cache to perform at speeds upto 8 GB/s. In order
      to accomplish that, we need build a index mechanism which operate in the order
      of multiple millions per sec rate.
      
      This patch provide the basic data structure to accomplish that:
      
      (1) Hash table implementation with lock contention spread
          It is based on the StripedHashSet<T> implementation in
          The Art of multiprocessor programming by Maurice Henry & Nir Shavit
      (2) LRU implementation
          Place holder algorithm for further optimizing
      (3) Evictable Hash Table implementation
          Building block for building index data structure that evicts data like files
          etc
      
      TODO:
      (1) Figure if the sharded hash table and LRU can be used instead
      (2) Figure if we need to support configurable eviction algorithm for
      EvictableHashTable
      
      Test Plan: Run unit tests
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D55785
      1f0142ce
  4. 28 4月, 2016 1 次提交
    • S
      Print memory allocation counters · 1c80dfab
      Sergey Makarenko 提交于
      Summary:
      Introduced option to dump malloc statistics using new option flag.
          Added new command line option to db_bench tool to enable this
          funtionality.
          Also extended build to support environments with/without jemalloc.
      
      Test Plan:
      1) Build rocksdb using `make` command. Launch the following command
          `./db_bench --benchmarks=fillrandom --dump_malloc_stats=true
          --num=10000000` end verified that jemalloc dump is present in LOG file.
          2) Build rocksdb using `DISABLE_JEMALLOC=1  make db_bench -j32` and ran
          the same db_bench tool and found the following message in LOG file:
          "Please compile with jemalloc to enable malloc dump".
          3) Also built rocksdb using `make` command on MacOS to verify behavior
          in non-FB environment.
          Also to debug build configuration change temporary changed
          AM_DEFAULT_VERBOSITY = 1 in Makefile to see compiler and build
          tools output. For case 1) -DROCKSDB_JEMALLOC was present in compiler
          command line. For both 2) and 3) this flag was not present.
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D57321
      1c80dfab
  5. 23 4月, 2016 1 次提交
    • D
      Alpine Linux Build (#990) · b71c4e61
      dx9 提交于
      * Musl libc does not provide adaptive mutex. Added feature test for PTHREAD_MUTEX_ADAPTIVE_NP.
      
      * Musl libc does not provide backtrace(3). Added a feature check for backtrace(3).
      
      * Fixed compiler error.
      
      * Musl libc does not implement backtrace(3). Added platform check for libexecinfo.
      
      * Alpine does not appear to support gcc -pg option. By default (gcc has PIE option enabled) it fails with:
      
      gcc: error: -pie and -pg|p|profile are incompatible when linking
      
      When -fno-PIE and -nopie are used it fails with:
      
      /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find gcrt1.o: No such file or directory
      
      Added gcc -pg platform test and output PROFILING_FLAGS accordingly. Replaced pg var in Makefile with PROFILING_FLAGS.
      
      * fix segfault when TEST_IOCTL_FRIENDLY_TMPDIR is undefined and default candidates are not suitable
      
      * use ASSERT_DOUBLE_EQ instead of ASSERT_EQ
      
      * When compiled with ROCKSDB_MALLOC_USABLE_SIZE UniversalCompactionFourPaths and UniversalCompactionSecondPathRatio tests fail due to premature memtable flushes on systems with 16-byte alignment. Arena runs out of block space before GenerateNewFile() completes.
      
      Increased options.write_buffer_size.
      b71c4e61
  6. 19 4月, 2016 1 次提交
    • Y
      Split db_test.cc · 792762c4
      Yi Wu 提交于
      Summary: Split db_test.cc into several files. Moving several helper functions into DBTestBase.
      
      Test Plan: make check
      
      Reviewers: sdong, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: dhruba, andrewkr, kradhakrishnan, yhchiang, leveldb, sdong
      
      Differential Revision: https://reviews.facebook.net/D56715
      792762c4
  7. 18 4月, 2016 1 次提交
    • Y
      Make more tests run in parallel · 6affd45d
      Yi Wu 提交于
      Summary:
      Generate t/run-* scripts to run tests in $PARALLEL_TEST separately, then make check_0 rule execute all of them.
      
      Run `time make check` after running `make all`.
      master: 71 sec
      with this diff: 63 sec.
      
      It seems moving more tests to $PARALLEL_TEST doesn't help improve test time though.
      
      Test Plan:
      Run the following
        make check
        J=16 make check
        J=1 make check
        make valgrind_check
        J=1 make valgrind_check
        J=16 make_valgrind_check
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, kradhakrishnan, dhruba, andrewkr, yhchiang
      
      Differential Revision: https://reviews.facebook.net/D56805
      6affd45d
  8. 16 4月, 2016 1 次提交
  9. 15 4月, 2016 1 次提交
    • S
      Allow valgrind_check to run in parallel · 3894603f
      sdong 提交于
      Summary:
      Extend "J=<parallel>" to valgrind_check.
      For DBTest, modify the script to run valgrind. For other tests, prefix launch command with valgrind.
      
      Test Plan: Run valgrind_check with J=1 and J>1 and make sure tests run under valgrind. Manually change codes to introduce memory leak and make sure "make watch-log" correctly report it.
      
      Reviewers: yhchiang, yiwu, andrewkr, kradhakrishnan, IslamAbdelRahman
      
      Reviewed By: kradhakrishnan, IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56727
      3894603f
  10. 14 4月, 2016 1 次提交
  11. 12 4月, 2016 1 次提交
    • S
      Don't run DBOptionsAllFieldsSettable under valgrind · a23c6052
      sdong 提交于
      Summary: Test DBOptionsAllFieldsSettable sometimes fails under valgrind. Move option settable tests to a separate test file and disable it in valgrind..
      
      Test Plan: Run valgrind test and make sure the test doesn't run.
      
      Reviewers: andrewkr, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: kradhakrishnan, yiwu, yhchiang, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56529
      a23c6052
  12. 31 3月, 2016 1 次提交
  13. 19 3月, 2016 1 次提交
    • A
      Add unit tests for RepairDB · e182f03c
      Andrew Kryczka 提交于
      Summary:
      Basic test cases:
      
      - Manifest is lost or corrupt
      - Manifest refers to too many or too few SST files
      - SST file is corrupt
      - Unflushed data is present when RepairDB is called
      
      Depends on D55065 for its CreateFile() function in file_utils
      
      Test Plan: Ran the tests.
      
      Reviewers: IslamAbdelRahman, yhchiang, yoshinorim, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D55485
      e182f03c
  14. 11 3月, 2016 1 次提交
    • Y
      Cache to have an option to fail Cache::Insert() when full · f71fc77b
      Yi Wu 提交于
      Summary:
      Cache to have an option to fail Cache::Insert() when full. Update call sites to check status and handle error.
      
      I totally have no idea what's correct behavior of all the call sites when they encounter error. Please let me know if you see something wrong or more unit test is needed.
      
      Test Plan: make check -j32, see tests pass.
      
      Reviewers: anthony, yhchiang, andrewkr, IslamAbdelRahman, kradhakrishnan, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D54705
      f71fc77b
  15. 03 3月, 2016 1 次提交
    • S
      Add Iterator Property rocksdb.iterator.version_number · e79ad9e1
      sdong 提交于
      Summary: We want to provide a way to detect whether an iterator is stale and needs to be recreated. Add a iterator property to return version number.
      
      Test Plan: Add two unit tests for it.
      
      Reviewers: IslamAbdelRahman, yhchiang, anthony, kradhakrishnan, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D54921
      e79ad9e1
  16. 29 2月, 2016 1 次提交
  17. 27 2月, 2016 1 次提交
  18. 24 2月, 2016 1 次提交
    • Y
      IOStatsContext::ToString() add option to exclude zero counters · 2568985a
      Yi Wu 提交于
      Summary: similar to D52809 add option to exclude zero counters.
      
      Test Plan:
      [yiwu@dev4504.prn1 ~/rocksdb] ./iostats_context_test
      [==========] Running 1 test from 1 test case.
      [----------] Global test environment set-up.
      [----------] 1 test from IOStatsContextTest
      [ RUN      ] IOStatsContextTest.ToString
      [       OK ] IOStatsContextTest.ToString (0 ms)
      [----------] 1 test from IOStatsContextTest (0 ms total)
      
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test case ran. (0 ms total)
      [  PASSED  ] 1 test.
      
      Reviewers: anthony, yhchiang, andrewkr, IslamAbdelRahman, kradhakrishnan, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D54591
      2568985a
  19. 16 2月, 2016 1 次提交
    • J
      Separeate main from bench functionality to allow cusomizations · 7bd284c3
      Jonathan Wiepert 提交于
      Summary: Isolate db_bench functionality from main so custom benchmark code can be written and managed
      
      Test Plan:
      Tested commands
      ./build_tools/regression_build_test.sh
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000 --reads=500 --writes=500
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000 --merge_keys=100 --numdistinct=100 --num_column_families=3 --num_hot_column_families=1
      ./db_bench --stats_interval_seconds=1 --num=1000 --bloom_locality=1 --seed=5 --threads=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --usee_uint64_comparator=true --batch-size=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --use_uint64_comparator=true --batch_size=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --usee_uint64_comparator=true --batch-size=5
      
      Test Results - https://phabricator.fb.com/P56130387
      
      Additional tests for:
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --use_uint64_comparator=true --batch_size=5 --key_size=8 --merge_operator=put
      ./db_bench --stats_interval_seconds=1 --num=1000 --bloom_locality=1 --seed=5 --threads=5 --merge_operator=uint64add
      
      Results: https://phabricator.fb.com/P56130607
      
      Reviewers: yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D53991
      7bd284c3
  20. 13 2月, 2016 2 次提交
  21. 04 2月, 2016 1 次提交
  22. 03 2月, 2016 1 次提交
    • A
      Generate tags for *.c files · 466c2c1b
      Andrew Kryczka 提交于
      Summary:
      db/c_test.c uses the functions in db/c.cc. If we have tags generated
      for one but not the other, it's easy to make mistakes like updating a function
      signature and missing a call site.
      
      Test Plan:
        $ make tags
      
      in vim:
      
        :cscope find s rocksdb_options_set_compression_options
        ...
        3    325  db/c_test.c <<main>>
                  rocksdb_options_set_compression_options(options, -14, -1, 0);
      
      Reviewers: sdong, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D53685
      466c2c1b
  23. 28 1月, 2016 1 次提交
  24. 27 1月, 2016 1 次提交
  25. 26 1月, 2016 1 次提交
    • V
      Run unit tests in parallel to find failing tests · 40911e0b
      Venkatesh Radhakrishnan 提交于
      Summary:
      Added make targets parallel_test and parallel_dbtest to run
      tests in parallel. Each test is run 32 times in parallel. There is a
      timeout to catch hangs. The test continues after a failure and reports
      non-zero status on failure
      
      Test Plan: Run the two make targets
      
      Reviewers: anthony, yhchiang, IslamAbdelRahman, kradhakrishnan, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D53079
      40911e0b
  26. 22 1月, 2016 1 次提交
    • K
      Mechanism to run CI jobs on local branch via commit_prereq · b0a15e7f
      krad 提交于
      Summary: This patch provides a mechanism to run pre commit tests on the local
      branch before committing. This can help prevent frequent build breaks.
      
      The tests can be run in parallel by specifying the J=<..> environment
      variable.
      
      Test Plan: Run manually
      
      Reviewers: sdong rven tec
      
      CC: leveldb@
      
      Task ID: #9689218
      
      Blame Rev:
      b0a15e7f
  27. 21 1月, 2016 1 次提交
    • A
      Split db_test.cc (part 1: properties) · eceb5cb1
      Andrew Kryczka 提交于
      Summary:
      Moved all the tests that verify property correctness into a separate
      file. The goal is to reduce compile time and complexity of db_test. I didn't
      add parallelism for db_properties_test, even though these tests were
      parallelized in db_test, since the file is small enough that it won't matter.
      
      Some of these moves may be controversial since it's hard to say whether the
      test is "verifying property correctness," or "using properties to verify
      rocksdb's correctness." I'm interested in any opinions.
      
      Test Plan: ran db_properties_test, also waiting on "make commit-prereq -j32"
      
      Reviewers: yhchiang, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D52995
      eceb5cb1
  28. 19 1月, 2016 2 次提交
    • B
      Simple changes to support builds for ppc64[le] consistent with X86 · f423f05d
      bcbrock 提交于
      These simple changes are required to allow builds on ppc64[le] systems
      consistent with X86. The Makefile now recognizes both ppc64 and ppc64le, and
      in the absence of PORTABLE=1, the code will be built analogously to the X86
      -march=native.
      
      Note that although GCC supports -mcpu=native -mtune=native on POWER, it
      doesn't work correctly on all systems. This is why we need to get the actual
      machine model from the AUX vector.
      f423f05d
    • D
      Changes for build on solaris · d78c6b28
      David Bernard 提交于
      Makefile adjust paths for solaris build
      Makefile enable _GLIBCXX_USE_C99 so that std::to_string is available
      db_compaction_test.cc Initialise a variable to avoid a compilation error
      db_impl.cc Include <alloca.h>
      db_test.cc Include <alloca.h>
      Environment.java recognise solaris envrionment
      options_bulder.cc Make log unambiguous
      geodb_impl.cc Make log and floor unambiguous
      d78c6b28
  29. 31 12月, 2015 2 次提交
    • I
      Fix clang build · bae5b0a1
      Islam AbdelRahman 提交于
      Summary:
      GTEST dont compile under clang when -Werror=missing-field-initializers is set
      revert this change
      
      Test Plan:
      USE_CLANG=1 make check
      make check
      
      Reviewers: rven
      
      Reviewed By: rven
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D52455
      bae5b0a1
    • N
      use -Werror=missing-field-initializers, to closer match MyRocks build · ac16663b
      Nathan Bronson 提交于
      Summary:
      myrocks seems to build rocksdb using
      -Wmissing-field-initializers (and treats warnings as errors).  This diff
      adds that flag to the rocksdb build, and fixes the compilation failures
      that result.  I have not checked for any other differences in the build
      flags for rocksdb build as part of myrocks.
      
      Test Plan: make check
      
      Reviewers: sdong, rven
      
      Reviewed By: rven
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D52443
      ac16663b
  30. 15 12月, 2015 1 次提交
  31. 11 12月, 2015 1 次提交
    • S
      env: add EnvMirror · 2074ddd6
      Sage Weil 提交于
      This is an Env implementation that mirrors all storage-related methods on
      two different backend Env's and verifies that they return the same
      results (return status and read results).  This is useful for implementing
      a new Env and verifying its correctness.
      Signed-off-by: NSage Weil <sage@redhat.com>
      2074ddd6
  32. 09 12月, 2015 1 次提交
  33. 25 11月, 2015 1 次提交
    • N
      InlineSkipList - part 1/3 · 78812ec6
      Nathan Bronson 提交于
      Summary:
      This diff is 1/3 in a sequence that introduces a skip list optimized for
      a key that is a freshly-allocated const char*.  The diff is broken into
      pieces to make it easier to review.  This piece only introduces the new
      type by copying the existing SkipList, with mechanical naming changes
      and reformatting.
      
      Test Plan: new unit test
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D51279
      78812ec6
  34. 19 11月, 2015 1 次提交
    • S
      Not to build forward_iterator_bench now · c4ebb66d
      sdong 提交于
      Summary: forward_iterator_bench is not stable enough for build. Remove it for now.
      
      Test Plan: Build it with both of CLANG and non-CLANG and make sure it builds.
      
      Reviewers: rven, kradhakrishnan, anthony, yhchiang, igor, IslamAbdelRahman
      
      Reviewed By: igor, IslamAbdelRahman
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D50991
      c4ebb66d
  35. 18 11月, 2015 1 次提交
    • Y
      Fix Java Makefile · 4189c0f9
      Yueh-Hsuan Chiang 提交于
      Summary:
      In case rocksdb java package is built using make rocksdbjavastaticrelease, then
      only those rocksdb binary built under the virtual environments is release build.
      
      This patch fix this issue.
      
      Test Plan:
      PORTABLE=1 V=2 make rocksdbjavastaticrelease -j32
      and make sure -O2 and -NDEBUG is included when compiling all source files.
      
      Reviewers: sdong, anthony, IslamAbdelRahman, rven, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D50895
      4189c0f9
  36. 14 11月, 2015 1 次提交
    • V
      Reuse file iterators in tailing iterator when memtable is flushed · 7824444b
      Venkatesh Radhakrishnan 提交于
      Summary:
      Under a tailing workload, there were increased block cache
      misses when a memtable was flushed because we were rebuilding iterators
      in that case since the version set changed. This was exacerbated in the
      case of iterate_upper_bound, since file iterators which were over the
      iterate_upper_bound would have been deleted and are now brought back as
      part of the Rebuild, only to be deleted again. We now renew the iterators
      and only build iterators for files which are added and delete file
      iterators for files which are deleted.
      Refer to https://reviews.facebook.net/D50463 for previous version
      
      Test Plan: DBTestTailingIterator.TailingIteratorTrimSeekToNext
      
      Reviewers: anthony, IslamAbdelRahman, igor, tnovak, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: yhchiang, march, dhruba, leveldb, lovro
      
      Differential Revision: https://reviews.facebook.net/D50679
      7824444b
  37. 12 11月, 2015 1 次提交
    • Y
      Add OptionsUtil::LoadOptionsFromFile() API · e11f676e
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch adds OptionsUtil::LoadOptionsFromFile() and
      OptionsUtil::LoadLatestOptionsFromDB(), which allow developers
      to construct DBOptions and ColumnFamilyOptions from a RocksDB
      options file.  Note that most pointer-typed options such as
      merge_operator will not be constructed.
      
      With this API, developers no longer need to remember all the
      options in order to reopen an existing rocksdb instance like
      the following:
      
        DBOptions db_options;
        std::vector<std::string> cf_names;
        std::vector<ColumnFamilyOptions> cf_opts;
      
        // Load primitive-typed options from an existing DB
        OptionsUtil::LoadLatestOptionsFromDB(
            dbname, &db_options, &cf_names, &cf_opts);
      
        // Initialize necessary pointer-typed options
        cf_opts[0].merge_operator.reset(new MyMergeOperator());
        ...
      
        // Construct the vector of ColumnFamilyDescriptor
        std::vector<ColumnFamilyDescriptor> cf_descs;
        for (size_t i = 0; i < cf_opts.size(); ++i) {
          cf_descs.emplace_back(cf_names[i], cf_opts[i]);
        }
      
        // Open the DB
        DB* db = nullptr;
        std::vector<ColumnFamilyHandle*> cf_handles;
        auto s = DB::Open(db_options, dbname, cf_descs,
                          &handles, &db);
      
      Test Plan:
      Augment existing tests in column_family_test
      options_test
      db_test
      
      Reviewers: igor, IslamAbdelRahman, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D49095
      e11f676e