1. 18 3月, 2015 5 次提交
    • A
      Create an abstract interface for write batches · 81345b90
      agiardullo 提交于
      Summary: WriteBatch and WriteBatchWithIndex now both inherit from a common abstract base class.  This makes it easier to write code that is agnostic toward the implementation of the particular write batch.  In particular, I plan on utilizing this abstraction to allow transactions to support using either implementation of a write batch.
      
      Test Plan: modified existing WriteBatchWithIndex tests to test new functions.  Running all tests.
      
      Reviewers: igor, rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34017
      81345b90
    • I
      Only run db_test in Travis · 46214df4
      Igor Canadi 提交于
      46214df4
    • I
      Deprecate removeScanCountLimit in NewLRUCache · c88ff4ca
      Igor Canadi 提交于
      Summary: It is no longer used by the implementation, so we should also remove it from the public API.
      
      Test Plan: make check
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34971
      c88ff4ca
    • I
      rocksdb: switch to gtest · b4b69e4f
      Igor Sugak 提交于
      Summary:
      Our existing test notation is very similar to what is used in gtest. It makes it easy to adopt what is different.
      In this diff I modify existing [[ https://code.google.com/p/googletest/wiki/Primer#Test_Fixtures:_Using_the_Same_Data_Configuration_for_Multiple_Te | test fixture ]] classes to inherit from `testing::Test`. Also for unit tests that use fixture class, `TEST` is replaced with `TEST_F` as required in gtest.
      
      There are several custom `main` functions in our existing tests. To make this transition easier, I modify all `main` functions to fallow gtest notation. But eventually we can remove them and use implementation of `main` that gtest provides.
      
      ```lang=bash
      % cat ~/transform
      #!/bin/sh
      files=$(git ls-files '*test\.cc')
      for file in $files
      do
        if grep -q "rocksdb::test::RunAllTests()" $file
        then
          if grep -Eq '^class \w+Test {' $file
          then
            perl -pi -e 's/^(class \w+Test) {/${1}: public testing::Test {/g' $file
            perl -pi -e 's/^(TEST)/${1}_F/g' $file
          fi
          perl -pi -e 's/(int main.*\{)/${1}::testing::InitGoogleTest(&argc, argv);/g' $file
          perl -pi -e 's/rocksdb::test::RunAllTests/RUN_ALL_TESTS/g' $file
        fi
      done
      % sh ~/transform
      % make format
      ```
      
      Second iteration of this diff contains only scripted changes.
      
      Third iteration contains manual changes to fix last errors and make it compilable.
      
      Test Plan:
      Build and notice no errors.
      ```lang=bash
      % USE_CLANG=1 make check -j55
      ```
      Tests are still testing.
      
      Reviewers: meyering, sdong, rven, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35157
      b4b69e4f
    • I
      Merge pull request #540 from dalgaaf/wip-da-fix-elif · 413e3527
      Igor Canadi 提交于
      Fix '#elif with no expression'
      413e3527
  2. 17 3月, 2015 11 次提交
  3. 16 3月, 2015 2 次提交
  4. 15 3月, 2015 6 次提交
    • I
      Make RecordIn/RecordOut human readable · c6967a1a
      Igor Canadi 提交于
      Summary: I had hard time understanding these big numbers. Here's how the output looks like now: https://gist.github.com/igorcanadi/4c39c17685049584a992
      
      Test Plan: db_bench
      
      Reviewers: sdong, MarkCallaghan
      
      Reviewed By: MarkCallaghan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35073
      c6967a1a
    • M
      Stop printing per-level stall times. · c8da6703
      Mark Callaghan 提交于
      Summary:
      Per-level stall times are the suggested stall time, not the actual stall time so this change stops printing them
      both in the per-level output lines and in the summary. Also changed output for total stall time to include units
      in all cases. The new output looks like:
      Level   Files   Size(MB) Score Read(GB)  Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) Comp(cnt) Avg(sec) Stall(cnt)    RecordIn   RecordDrop
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        L0     4/1          7   0.8      0.0     0.0      0.0       0.6      0.6       0.0   0.0      0.0     12.9        50       352    0.141        882            0            0
        L1     5/0          9   0.9      0.0     0.0      0.0       0.0      0.0       0.6   0.0      0.0      0.0         0         0    0.000          0            0            0
        L2    54/0         99   1.0      0.0     0.0      0.0       0.0      0.0       0.6   0.0      0.0      0.0         0         0    0.000          0            0            0
        L3   289/0        527   0.5      0.0     0.0      0.0       0.0      0.0       0.5   0.0      0.0      0.0         0         0    0.000          0            0            0
       Sum   352/1        642   0.0      0.0     0.0      0.0       0.6      0.6       1.7   1.0      0.0     12.9        50       352    0.141        882            0            0
       Int     0/0          0   0.0      0.0     0.0      0.0       0.0      0.0       0.0   1.0      0.0     15.5         0         3    0.118          7            0            0
      Flush(GB): accumulative 0.627, interval 0.005
      Stalls(count): 0 level0_slowdown, 0 level0_numfiles, 882 memtable_compaction, 0 leveln_slowdown_soft, 0 leveln_slowdown_hard
      
      Task ID: #6493861
      
      Blame Rev:
      
      Test Plan:
      run db_bench, look at output
      
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D35085
      c8da6703
    • F
      [RocksJava] OptimizeFiltersForHits · 04778a94
      fyrz 提交于
      Summary: Added optimize_filters_for_hits option.
      
      Test Plan:
      make clean jclean rocksdbjava jtest
      mvn -f rocksjni.pom package
      
      Reviewers: adamretter, yhchiang, ankgup87
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D35013
      04778a94
    • F
      RocksJava - JNI Logger callback · 57f2a00c
      fyrz 提交于
      Summary:
      Within this commit a new AbstractLogger was introduced
      which allows to handle log messages at an application level.
      
      Log messages are passed up to Java using a JNI callback.
      
      This allows a Java-Developer to use common Java APIs for log
      messages e.g. SLF4J, LOG4J, etc. Within this commit no new
      dependencies were introduced, which keeps the RocksDB API clean
      and doesn`t force a developer to use a predefined high-level Java API.
      
      Another feature is to dynamically set a custom loggers verbosity at
      runtime using its public method `setInfoLogLevel` and to retrieve
      the currently active level using the `infoLogLevel` method.
      
      Test Plan:
      make clean jclean rocksdbjava jtest
      mvn -f rocksjni.pom package
      
      Reviewers: adamretter, ankgup87, yhchiang
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D34755
      57f2a00c
    • F
      [RocksJava] Change log level at runtime in custom logger · 814627af
      fyrz 提交于
      This commit introduces the possibility to change the log level
      of a used custom logger at runtime.
      814627af
    • F
      [RocksJava] Logging JNI callback · a3bd4142
      fyrz 提交于
      Within this commit a new AbstractLogger was introduced
      which pushes info log messages all the way up to Java.
      a3bd4142
  5. 14 3月, 2015 15 次提交
    • M
      Switch to use_existing_db=1 for updaterandom and mergerandom · 58878f1c
      Mark Callaghan 提交于
      Summary:
      Without this change about half of the updaterandom reads and merge puts will be for keys that don't exist.
      I think it is better for these tests to start with a full database and use fillseq to fill it.
      
      Task ID: #
      
      Blame Rev:
      
      Test Plan:
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D35043
      58878f1c
    • Y
      Fixed the unit-test issue in PreShutdownCompactionMiddle · 12134139
      Yueh-Hsuan Chiang 提交于
      Summary: Fixed the unit-test issue in PreShutdownCompactionMiddle
      
      Test Plan: export ROCKSDB_TESTS=PreShutdownCompactionMiddle
      
      Reviewers: rven, sdong, igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35061
      12134139
    • Y
      Fix the issue in PreShutdownMultipleCompaction · fd1b3f38
      Yueh-Hsuan Chiang 提交于
      Summary: Fix the issue in PreShutdownMultipleCompaction
      
      Test Plan:
      export ROCKSDB_TESTS=PreShutdownMultipleCompaction
      ./db_test
      
      Reviewers: rven, sdong, igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35055
      fd1b3f38
    • Y
      Fix compile warning in thread_status_util.h on Mac · 56c4a9c7
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fix compile warning in thread_status_util.h on Mac
      
      Test Plan:
      make dbg -j32
      56c4a9c7
    • I
      Fix SIGSEGV when not using cache · 417367c4
      Igor Canadi 提交于
      417367c4
    • V
      Prevent slowdowns and stalls in PreShutdown tests · e25ff039
      Venkatesh Radhakrishnan 提交于
      Summary:
      The preshutdown tests check for stopped compactions/flushes.
      Removing stalls on the write path.
      
      Test Plan: DBTests.PreShutdown*
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35037
      e25ff039
    • I
      Speed up db_bench shutdown · f6907126
      Igor Canadi 提交于
      Summary: See t6489044
      
      Test Plan: compiles
      
      Reviewers: MarkCallaghan
      
      Reviewed By: MarkCallaghan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34977
      f6907126
    • Y
      Improve the robustness of ThreadStatusSingleCompaction · c1b3cde1
      Yueh-Hsuan Chiang 提交于
      Summary:
      Improve the robustness of ThreadStatusSingleCompaction
      by ensuring the number of files flushed in the test.
      
      Test Plan:
      export ROCKSDB_TESTS=ThreadStatus
      ./db_test
      
      Reviewers: sdong, igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35019
      c1b3cde1
    • Y
      Fix the deadlock issue in ThreadStatusSingleCompaction. · 8c12426c
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fix the deadlock issue in ThreadStatusSingleCompaction.
      
      In the previous version of ThreadStatusSingleCompaction, the compaction
      thread will wait for a SYNC_POINT while its db_mutex is held.  However,
      if the test hasn't finished its Put cycle while a compaction is running,
      a deadlock will happen in the test.
      
      Test Plan:
      export ROCKSDB_TESTS=ThreadStatus
      ./db_test
      
      Reviewers: sdong, igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35001
      8c12426c
    • S
      DBTest.DynamicLevelCompressionPerLevel should not run without snappy support · b16ead53
      sdong 提交于
      Summary: The test depends on snappy to be used. Skip the test if it is not supported.
      
      Test Plan: Run the test
      
      Reviewers: meyering, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D34995
      b16ead53
    • Y
      Fix a typo / test failure in ThreadStatusSingleCompaction · a5e60baf
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fix a typo / test failure in ThreadStatusSingleCompaction
      
      Test Plan:
      export ROCKSDB_TESTS=ThreadStatus
      ./db_test
      a5e60baf
    • I
      Don't run some tests is snappy is not present · cb2c9185
      Igor Canadi 提交于
      Summary: Currently, we have `ifdef SNAPPY` around bunch of db_test code. Some tests that don't even use compression are also blocked when running system doesn't have snappy. This also causes hard-to-catch bugs, like D34983. We should dynamically figure out if compression is supported or not.
      
      Test Plan: compiles
      
      Reviewers: sdong, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34989
      cb2c9185
    • Y
      Allow GetThreadList() to report operation stage. · c594b0e8
      Yueh-Hsuan Chiang 提交于
      Summary: Allow GetThreadList() to report operation stage.
      
      Test Plan:
        ./thread_list_test
        ./db_bench --benchmarks=fillrandom --num=100000 --threads=40 \
          --max_background_compactions=10 --max_background_flushes=3 \
          --thread_status_per_interval=1000 --key_size=16 --value_size=1000 \
          --num_column_families=10
      
        export ROCKSDB_TESTS=ThreadStatus
        ./db_test
      
      Sample output
                ThreadID ThreadType                    cfName    Operation        OP_StartTime    ElapsedTime                                         Stage        State
         140116265861184    Low Pri
         140116270055488    Low Pri
         140116274249792   High Pri column_family_name_000005        Flush 2015/03/10-14:58:11           0 us                    FlushJob::WriteLevel0Table
         140116400078912    Low Pri column_family_name_000004   Compaction 2015/03/10-14:58:11           0 us     CompactionJob::FinishCompactionOutputFile
         140116358135872    Low Pri column_family_name_000006   Compaction 2015/03/10-14:58:10           1 us     CompactionJob::FinishCompactionOutputFile
         140116341358656    Low Pri
         140116295221312   High Pri                   default        Flush 2015/03/10-14:58:11           0 us                    FlushJob::WriteLevel0Table
         140116324581440    Low Pri column_family_name_000009   Compaction 2015/03/10-14:58:11           0 us      CompactionJob::ProcessKeyValueCompaction
         140116278444096    Low Pri
         140116299415616    Low Pri column_family_name_000008   Compaction 2015/03/10-14:58:11           0 us     CompactionJob::FinishCompactionOutputFile
         140116291027008   High Pri column_family_name_000001        Flush 2015/03/10-14:58:11           0 us                    FlushJob::WriteLevel0Table
         140116286832704    Low Pri column_family_name_000002   Compaction 2015/03/10-14:58:11           0 us     CompactionJob::FinishCompactionOutputFile
         140116282638400    Low Pri
      
      Reviewers: rven, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34683
      c594b0e8
    • I
      Include chrono · 2623b2cf
      Igor Canadi 提交于
      2623b2cf
    • I
      EventLogger · 52d8347a
      Igor Canadi 提交于
      Summary:
      Here's my proposal for making our LOGs easier to read by machines.
      
      The idea is to dump all events as JSON objects. JSON is easy to read by humans, but more importantly, it's easy to read by machines. That way, we can parse this, load into SQLite/mongo and then query or visualize.
      
      I started with table_create and table_delete events, but if everybody agrees, I'll continue by adding more events (flush/compaction/etc etc)
      
      Test Plan:
      Ran db_bench. Observed:
      2015/01/15-14:13:25.788019 1105ef000 EVENT_LOG_v1 {"time_micros": 1421360005788015, "event": "table_file_creation", "file_number": 12, "file_size": 1909699}
      2015/01/15-14:13:25.956500 110740000 EVENT_LOG_v1 {"time_micros": 1421360005956498, "event": "table_file_deletion", "file_number": 12}
      
      Reviewers: yhchiang, rven, dhruba, MarkCallaghan, lgalanis, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D31647
      52d8347a
  6. 13 3月, 2015 1 次提交