1. 30 7月, 2016 3 次提交
    • A
      Added missing Java ReadOptions settings (#1109) · 8796934a
      Adam Retter 提交于
      * Minor reorganisation
      
      * Java API - Added missing ReadOptions settings
      8796934a
    • I
      Make DBTest.CompressionStatsTest more deterministic · 5e2c7965
      Islam AbdelRahman 提交于
      Summary:
      DBTest.CompressionStatsTest on non_shm test where the storage device is slow
      
      DBTest.CompressionStatsTest assumes that a flush happens to check the number of compressed blocks.
      This is not always true if the Flush is slow, make the test more deterministic by forcing a flush before doing the check
      
      Test Plan: Run the test locally
      
      Reviewers: andrewkr, yiwu, lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61317
      5e2c7965
    • I
      Fix db_stress failure (pass merge_operator even if not used) · 557748ff
      Islam AbdelRahman 提交于
      Summary:
      db_stress test is now failing because of this scenario
      - run db_stress with merge_operator enabled (now we have a db with merge operands)
      - run db_stress with merge_operator disabled (now when we fail to open the db)
      
      the solution is to pass the merge_operator to the DB even if we are not going to do any merge operations
      
      Test Plan: Check the failure
      
      Reviewers: andrewkr, yiwu, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61311
      557748ff
  2. 29 7月, 2016 2 次提交
    • A
    • A
      Simplify thread-local static initialization · afad5bd1
      Andrew Kryczka 提交于
      Summary:
      The call stack used to look like this during static initialization:
      
        #0  0x00000000008032d1 in rocksdb::ThreadLocalPtr::StaticMeta::StaticMeta() (this=0x7ffff683b300) at util/thread_local.cc:172
        #1  0x00000000008030a7 in rocksdb::ThreadLocalPtr::Instance() () at util/thread_local.cc:135
        #2  0x000000000080310f in rocksdb::ThreadLocalPtr::StaticMeta::Mutex() () at util/thread_local.cc:141
        #3  0x0000000000803103 in rocksdb::ThreadLocalPtr::StaticMeta::InitSingletons() () at util/thread_local.cc:139
        #4  0x000000000080305d in rocksdb::ThreadLocalPtr::InitSingletons() () at util/thread_local.cc:106
      
      It involves outer/inner classes and the call stacks goes
      outer->inner->outer->inner, which is too difficult to understand. We can avoid
      a level of back-and-forth by skipping StaticMeta::InitSingletons(), which
      doesn't initialize anything beyond what ThreadLocalPtr::Instance() already
      initializes.
      
      Now the call stack looks like this during static initialization:
      
        #0  0x00000000008032c5 in rocksdb::ThreadLocalPtr::StaticMeta::StaticMeta() (this=0x7ffff683b300) at util/thread_local.cc:170
        #1  0x00000000008030a7 in rocksdb::ThreadLocalPtr::Instance() () at util/thread_local.cc:135
        #2  0x000000000080305d in rocksdb::ThreadLocalPtr::InitSingletons() () at util/thread_local.cc:106
      
      Test Plan:
      unit tests
      
      verify StaticMeta::mutex_ is still initialized in DefaultEnv() (StaticMeta::mutex_ is the only variable intended to be initialized via StaticMeta::InitSingletons() which I removed)
      
        #0  0x00000000005cee17 in rocksdb::port::Mutex::Mutex(bool) (this=0x7ffff69500b0, adaptive=false) at port/port_posix.cc:52
        #1  0x0000000000769cf8 in rocksdb::ThreadLocalPtr::StaticMeta::StaticMeta() (this=0x7ffff6950000) at util/thread_local.cc:168
        #2  0x0000000000769a53 in rocksdb::ThreadLocalPtr::Instance() () at util/thread_local.cc:133
        #3  0x0000000000769a09 in rocksdb::ThreadLocalPtr::InitSingletons() () at util/thread_local.cc:105
        #4  0x0000000000647d98 in rocksdb::Env::Default() () at util/env_posix.cc:845
      
      Reviewers: lightmark, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: arahut, IslamAbdelRahman, yiwu, andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60813
      afad5bd1
  3. 28 7月, 2016 6 次提交
    • G
      Remove an extra apostrophe · 6920cde8
      Gunnar Kudrjavets 提交于
      6920cde8
    • A
      add InDomain regression test · e72ea485
      Aaron Gao 提交于
      Summary: regression tests to make sure seek keys not in domain would not fail assertion
      
      Test Plan:
      ```
      [gzh@dev6163.prn2 ~/local/rocksdb] ./prefix_test --gtest_filter=SamePrefixTest.*
      /tmp/rocksdbtest-112628/prefix_test
      Note: Google Test filter = SamePrefixTest.*
      [==========] Running 1 test from 1 test case.
      [----------] Global test environment set-up.
      [----------] 1 test from SamePrefixTest
      [ RUN      ] SamePrefixTest.InDomainTest
      [       OK ] SamePrefixTest.InDomainTest (211 ms)
      [----------] 1 test from SamePrefixTest (211 ms total)
      
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test case ran. (211 ms total)
      ```
      
      Reviewers: andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D61161
      e72ea485
    • G
      Avoid duplicate task creation for RocksDB contruns · 9c8ac144
      Gunnar Kudrjavets 提交于
      Summary: We rely on a basic evaluation logic: when using an expression `A || B`, the `B` part will only get evaluated when `A` fails. Therefore the task creation tool is guaranteed to run if previous build/test step failed. To indicate the correct return value to shell, the task creation tool will call `exit(1)` which will cause Sandcastle to mark it as a failure.
      
      Test Plan:
      - Land the changes.
      - Trigger a RocksDB contrun - observe the results.
      - Look at the results from the nightly runs and fix issues as necessary.
      
      Current testing so far has been in isolation for various components.
      
      Reviewers: andrewkr, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60909
      9c8ac144
    • S
      db_stress shouldn't assert file size 0 if file creation fails · d4c45428
      sdong 提交于
      Summary: OnTableFileCreated() now is also called when the file creaion fails. In that case, we shouldn't assert the file size is not 0.
      
      Test Plan: Run crash test
      
      Reviewers: yiwu, andrewkr, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: IslamAbdelRahman, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61137
      d4c45428
    • A
      Testing out parallel sandcastle changes · d3bfd339
      Anirban Rahut 提交于
      Summary:
      Removing moreutils from sandcastle and adding gnu parallel.
      Then passing in J= nproc command
      
      Test Plan: Testing on sandcastle
      
      Reviewers: sdong, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61017
      d3bfd339
    • S
      Increse timeout in some tests · 7efd9c25
      sdong 提交于
      Summary: Increase test timeout to some tests to unblock CI.
      
      Test Plan: watch how it runs.
      
      Reviewers: kradhakrishnan, andrewkr, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: IslamAbdelRahman, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61263
      7efd9c25
  4. 27 7月, 2016 9 次提交
  5. 26 7月, 2016 8 次提交
    • A
      Run error-filtering script on diff-triggered tests · 9498069f
      Andrew Kryczka 提交于
      Summary:
      this script creates a summary message based on the test type and
      output. Previously it only ran during contbuild. This diff makes it also
      run on commit-triggered diffs.
      
      Test Plan: will see if it works on diff's sandcastle tests
      
      Reviewers: kradhakrishnan, lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60879
      9498069f
    • I
      Fix Statistics TickersNameMap miss match with Tickers enum · f8061a23
      Islam AbdelRahman 提交于
      Summary:
      TickersNameMap is not consistent with Tickers enum.
      this cause us to report wrong statistics and sometimes to access TickersNameMap outside it's boundary causing crashes (in Fb303 statistics)
      
      Test Plan: added new unit test
      
      Reviewers: sdong, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61083
      f8061a23
    • I
      Fix MergeContext::copied_operands_ strings moving · 16e225f7
      Islam AbdelRahman 提交于
      Summary:
      MergeContext::copied_operands contain strings that MergeContext::operand_list_ Slices point to
      It's possible that when MergeContext::copied_operands grow, these strings are moved and there place in memory is changed, this will cause MergeContext::operand_list_ to point to invalid memory.
      fix this problem by using unique_ptr<string> instead of string
      
      Test Plan: run tests under mac/clang
      
      Reviewers: sdong, yiwu
      
      Reviewed By: yiwu
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61023
      16e225f7
    • K
      Run sandcastle tests in /dev/shm · a4955b39
      krad 提交于
      a4955b39
    • Y
      Fix flaky DBSSTTEST::DeleteObsoleteFilesPendingOutputs · ae0ad719
      Yi Wu 提交于
      Summary: The test is flaky on Travis in osx environment. The background flush the test wanting to block can run behind the L2 manual compaction, making the test actually blocking the L2 compaction and won't able to proceed.
      
      Test Plan: Test run on travis
      
      Reviewers: kradhakrishnan, sdong, andrewkr, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D61101
      ae0ad719
    • Z
      Update db_bench_tool.cc (#1239) · b2a8016d
      zhang-tong 提交于
      * Update db_bench_tool.cc
      
      * Update db_bench_tool.cc
      b2a8016d
    • Y
      Disable two dynamic options tests under lite build · c6654588
      Yi Wu 提交于
      Summary: RocksDB lite don't support dynamic options. Disable the two test from lite build, and assert `SetOptions` should return `status::OK`.
      
      Test Plan: Run the db_options test under lite build and normal build.
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D61119
      c6654588
    • S
      Ignore stale logs while restarting DBs · 2a6d0cde
      sdong 提交于
      Summary:
      Stale log files can be deleted out of order. This can happen for various reasons. One of the reason is that no data is ever inserted to a column family and we have an optimization to update its log number, but not all the old log files are cleaned up (the case shown in the unit tests added). It can also happen when we simply delete multiple log files out of order.
      
      This causes data corruption because we simply increase seqID after processing the next row and we may end up with writing data with smaller seqID than what is already flushed to memtables.
      
      In DB recovery, for the oldest files we are replaying, if there it contains no data for any column family, we ignore the sequence IDs in the file.
      
      Test Plan: Add two unit tests that fail without the fix.
      
      Reviewers: IslamAbdelRahman, igor, yiwu
      
      Reviewed By: yiwu
      
      Subscribers: hermanlee4, yoshinorim, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60891
      2a6d0cde
  6. 24 7月, 2016 1 次提交
  7. 23 7月, 2016 5 次提交
    • S
      Re-enable tsan crash white-box test with reduced killing odds · f85df120
      sdong 提交于
      Summary:
      Tsan crash white-box test was disabled because it never ends. Re-enable it with reduced killing odds.
      Add a parameter in crash test script to allow we pass it through an environment variable.
      
      Test Plan: Run it manually.
      
      Reviewers: IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D61053
      f85df120
    • I
      Update README.md to include appveyor badge · 89e4c488
      Islam AbdelRahman 提交于
      Update README.md to include appveyor badge
      89e4c488
    • P
      ldb load, prefer ifsteam(/dev/stdin) to std::cin (#1207) · b06ca5f8
      Peter (Stig) Edwards 提交于
      getline on std::cin can be very inefficient when ldb is loading large values, with high CPU usage in libc _IO_(un)getc, this is because of the performance penalty that comes from synchronizing stdio and iostream buffers.
      See the reproducers and tests in #1133 .
      If an ifstream on /dev/stdin is used (when available) then using ldb to load large values can be much more efficient.
      I thought for ldb load, that this approach is preferable to using <cstdio> or std::ios_base::sync_with_stdio(false).
      I couldn't think of a use case where ldb load would need to support reading unbuffered input, an alternative approach would be to add support for passing --input_file=/dev/stdin.
      I have a CLA in place, thanks.
      
      The CI tests were failing at the time of https://github.com/facebook/rocksdb/pull/1156, so this change and PR will supersede it.
      b06ca5f8
    • S
      Revert "Remove bashism from `make check` (#1225)" · 4ea0ab3c
      sdong 提交于
      This reverts commit 08ab1d83.
      4ea0ab3c
    • A
      fixes 1220: rocksjni build fails on Windows due to variable-size array declaration (#1223) · 12767b31
      Alexander Jipa 提交于
      * fixes 1220: rocksjni build fails on Windows due to variable-size array declaration
      
      using new keyword to create variable-size arrays in order to satisfy most of the compilers
      
      * fixes 1220: rocksjni build fails on Windows due to variable-size array declaration
      
      using unique_ptr keyword to create variable-size arrays in order to satisfy most of the compilers
      12767b31
  8. 22 7月, 2016 6 次提交
    • A
      Update .gitignore for internal release · a9d512a7
      Andrew Kryczka 提交于
      a9d512a7
    • S
      Need to make sure log file synced before flushing memtable of one column family · d5a51d4d
      sdong 提交于
      Summary: Multiput atomiciy is broken across multiple column families if we don't sync WAL before flushing one column family. The WAL file may contain a write batch containing writes to a key to the CF to be flushed and a key to other CF. If we don't sync WAL before flushing, if machine crashes after flushing, the write batch will only be partial recovered. Data to other CFs are lost.
      
      Test Plan: Add a new unit test which will fail without the diff.
      
      Reviewers: yhchiang, IslamAbdelRahman, igor, yiwu
      
      Reviewed By: yiwu
      
      Subscribers: yiwu, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60915
      d5a51d4d
    • Y
      Fix unit test which breaks lite build · 89f319c2
      Yi Wu 提交于
      Summary: Comment out assertion of number of table files from lite build.
      
      Test Plan:
          OPT=-DROCKSDB_LITE make check
      
      Reviewers: lightmark
      
      Reviewed By: lightmark
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60999
      89f319c2
    • S
      Add unit test not on /dev/shm as part of the pre-commit tests · b5063292
      sdong 提交于
      Summary: RocksDB behavior is slightly different between data on tmpfs and normal file systems. Add a test case to run RocksDB on normal file system.
      
      Test Plan: See the tests launched by Phabricator
      
      Reviewers: kradhakrishnan, IslamAbdelRahman, gunnarku
      
      Reviewed By: gunnarku
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60963
      b5063292
    • K
      Bump next release version · b9a97181
      krad 提交于
      Summary: Bump master version to the next potential release version of 4.11
      
      Test Plan: Compile
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60993
      b9a97181
    • R
      Add EnvLibrados - RocksDB Env of RADOS (#1222) · 663afef8
      ryneli 提交于
      EnvLibrados is a customized RocksDB Env to use RADOS as the backend file system of RocksDB. It overrides all file system related API of default Env. The easiest way to use it is just like following:
      
      	std::string db_name = "test_db";
      	std::string config_path = "path/to/ceph/config";
      	DB* db;
      	Options options;
      	options.env = EnvLibrados(db_name, config_path);
      	Status s = DB::Open(options, kDBPath, &db);
      
      Then EnvLibrados will forward all file read/write operation to the RADOS cluster assigned by config_path. Default pool is db_name+"_pool".
      
      There are some options that users could set for EnvLibrados.
      - write_buffer_size. This variable is the max buffer size for WritableFile. After reaching the buffer_max_size, EnvLibrados will sync buffer content to RADOS, then clear buffer.
      - db_pool. Rather than using default pool, users could set their own db pool name
      - wal_dir. The dir for WAL files. Because RocksDB only has 2-level structure (dir_name/file_name), the format of wal_dir is "/dir_name"(CAN'T be "/dir1/dir2"). Default wal_dir is "/wal".
      - wal_pool. Corresponding pool name for WAL files. Default value is db_name+"_wal_pool"
      
      The example of setting options looks like following:
      
      	db_name = "test_db";
      	db_pool = db_name+"_pool";
      	wal_dir = "/wal";
      	wal_pool = db_name+"_wal_pool";
      	write_buffer_size = 1 << 20;
      	env_ = new EnvLibrados(db_name, config, db_pool, wal_dir, wal_pool, write_buffer_size);
      
      	DB* db;
      	Options options;
      	options.env = env_;
      	// The last level dir name should match the dir name in prefix_pool_map
      	options.wal_dir = "/tmp/wal";
      
      	// open DB
      	Status s = DB::Open(options, kDBPath, &db);
      
      Librados is required to compile EnvLibrados. Then use "$make LIBRADOS=1" to compile RocksDB. If you want to only compile EnvLibrados test, just run "$ make env_librados_test LIBRADOS=1". To run env_librados_test, you need to have a running RADOS cluster with the configure file located in "../ceph/src/ceph.conf" related to "rocksdb/".
      663afef8