1. 16 1月, 2015 1 次提交
    • T
      Ported LevelDB's fault_injection_test · d10f1de2
      Thomas Dudziak 提交于
      Summary:
      This is a port of [[ https://github.com/google/leveldb/blob/master/db/fault_injection_test.cc | LevelDB's fault_injection_test ]] to RocksDB. Unfortunately it fails with:
      
      ```
      ==== Test FaultInjectionTest.FaultTest
      db/fault_injection_test.cc:491: Corruption: no meta-nextfile entry in descriptor
      #0   ./fault_injection_test() [0x41477a] rocksdb::FaultInjectionTest::PartialCompactTestReopenWithFault(rocksdb::FaultInjectionTest::ResetMethod, int, int) /data/users/tomdzk/rocksdb/db/fault_injection_test.cc:491
      #1   ./fault_injection_test() [0x40a38a] rocksdb::_Test_FaultTest::_Run() /data/users/tomdzk/rocksdb/db/fault_injection_test.cc:517
      #2   ./fault_injection_test() [0x415bea] rocksdb::_Test_FaultTest::_RunIt() /data/users/tomdzk/rocksdb/db/fault_injection_test.cc:507
      #3   ./fault_injection_test() [0x584367] rocksdb::test::RunAllTests() /data/users/tomdzk/rocksdb/util/testharness.cc:70
      #4   /usr/local/fbcode/gcc-4.8.1-glibc-2.17/lib/libc.so.6(__libc_start_main+0x10e) [0x7f7a40857efe] ??  ??:0
      #5   ./fault_injection_test() [0x408bb8] _start ??:0
      ```
      
      so I commented out the test invocation in the source code for now (lines 514-520) so it can be merged.
      
      Test Plan: This is a new test.
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D31587
      d10f1de2
  2. 08 1月, 2015 2 次提交
    • I
      :%s/build_config/make_config · b89d58df
      Igor Canadi 提交于
      Summary: I'm tired of double-tab when opening build_tools/<something>. This change will make bu<tab> fully complete my path :)
      
      Test Plan: `vi bu<tab>` gives me `vi build_tools/` yay!
      
      Reviewers: yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D30639
      b89d58df
    • A
      Memtablerep Benchmark · 242b9769
      Ameya Gupte 提交于
      Summary:
      Create a benchmark for testing memtablereps. This diff is a bit rough, but it should do the trick until other bootcampers can clean it up.
      
      Addressing comments
      Removed the mutexes
      Changed ReadWriteBenchmark to fix number of reads and count the number of writes we can perform in that time.
      
      Test Plan:
      Run it.
      
      Below runs pass
      ./memtablerep_bench --benchmarks fillrandom,readrandom --memtablerep skiplist
      
      ./memtablerep_bench --benchmarks fillseq,readseq --memtablerep skiplist
      
      ./memtablerep_bench --benchmarks readwrite,seqreadwrite --memtablerep skiplist --num_operations 200 --num_threads 5
      
      ./memtablerep_bench --benchmarks fillrandom,readrandom --memtablerep hashskiplist
      
      ./memtablerep_bench --benchmarks fillseq,readseq --memtablerep hashskiplist
       --num_scans 2
      
      ./memtablerep_bench --benchmarks fillseq,readseq --memtablerep vector
      
      Reviewers: jpaton, ikabiljo, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, ameyag
      
      Differential Revision: https://reviews.facebook.net/D22683
      242b9769
  3. 24 12月, 2014 1 次提交
  4. 23 12月, 2014 1 次提交
  5. 06 12月, 2014 2 次提交
  6. 02 12月, 2014 1 次提交
  7. 01 12月, 2014 1 次提交
  8. 21 11月, 2014 1 次提交
    • Y
      Introduce GetThreadList API · d0c5f28a
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add GetThreadList API, which allows developer to track the
      status of each process.  Currently, calling GetThreadList will
      only get the list of background threads in RocksDB with their
      thread-id and thread-type (priority) set.  Will add more support
      on this in the later diffs.
      
      ThreadStatus currently has the following properties:
      
        // An unique ID for the thread.
        const uint64_t thread_id;
      
        // The type of the thread, it could be ROCKSDB_HIGH_PRIORITY,
        // ROCKSDB_LOW_PRIORITY, and USER_THREAD
        const ThreadType thread_type;
      
        // The name of the DB instance where the thread is currently
        // involved with.  It would be set to empty string if the thread
        // does not involve in any DB operation.
        const std::string db_name;
      
        // The name of the column family where the thread is currently
        // It would be set to empty string if the thread does not involve
        // in any column family.
        const std::string cf_name;
      
        // The event that the current thread is involved.
        // It would be set to empty string if the information about event
        // is not currently available.
      
      Test Plan:
      ./thread_list_test
      export ROCKSDB_TESTS=GetThreadList
      ./db_test
      
      Reviewers: rven, igor, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D25047
      d0c5f28a
  9. 20 11月, 2014 2 次提交
    • F
      [RocksJava] Strip library in publish · 91c8dcef
      fyrz 提交于
      Currently maven publishing uses the library with debug symbols. What
      leads to unnecessary big library sizes. Included strip to remove
      unnecessary stuff. 40M -> 2.7M
      91c8dcef
    • F
      [RocksJava] JavaDoc is executed too often · e7fcaa4d
      fyrz 提交于
      Previous to this commit too much targets got dependencies
      on javadocs target.
      
      Introduced one additional target "javalib" which resolves
      that situation. JavaDoc will now be generated once while
      executing a task with prefix "rocksdbjava".
      e7fcaa4d
  10. 15 11月, 2014 1 次提交
    • I
      CompactionJobTest · 9be338cf
      Igor Canadi 提交于
      Summary:
      This is just a simple test that passes two files though a compaction. It shows the framework so that people can continue building new compaction *unit* tests.
      In the future we might want to move some Compaction* tests from DBTest here. For example, CompactBetweenSnapshot seems a good candidate.
      
      Hopefully this test can be simpler when we mock out VersionSet.
      
      Test Plan: this is a test
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28449
      9be338cf
  11. 12 11月, 2014 1 次提交
    • I
      Turn on -Wshorten-64-to-32 and fix all the errors · 767777c2
      Igor Canadi 提交于
      Summary:
      We need to turn on -Wshorten-64-to-32 for mobile. See D1671432 (internal phabricator) for details.
      
      This diff turns on the warning flag and fixes all the errors. There were also some interesting errors that I might call bugs, especially in plain table. Going forward, I think it makes sense to have this flag turned on and be very very careful when converting 64-bit to 32-bit variables.
      
      Test Plan: compiles
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: yhchiang
      
      Subscribers: bobbaldwin, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28689
      767777c2
  12. 11 11月, 2014 2 次提交
  13. 08 11月, 2014 2 次提交
    • Y
      CompactFiles, EventListener and GetDatabaseMetaData · 28c82ff1
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff adds three sets of APIs to RocksDB.
      
      = GetColumnFamilyMetaData =
      * This APIs allow users to obtain the current state of a RocksDB instance on one column family.
      * See GetColumnFamilyMetaData in include/rocksdb/db.h
      
      = EventListener =
      * A virtual class that allows users to implement a set of
        call-back functions which will be called when specific
        events of a RocksDB instance happens.
      * To register EventListener, simply insert an EventListener to ColumnFamilyOptions::listeners
      
      = CompactFiles =
      * CompactFiles API inputs a set of file numbers and an output level, and RocksDB
        will try to compact those files into the specified level.
      
      = Example =
      * Example code can be found in example/compact_files_example.cc, which implements
        a simple external compactor using EventListener, GetColumnFamilyMetaData, and
        CompactFiles API.
      
      Test Plan:
      listener_test
      compactor_test
      example/compact_files_example
      export ROCKSDB_TESTS=CompactFiles
      db_test
      export ROCKSDB_TESTS=MetaData
      db_test
      
      Reviewers: ljin, igor, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: MarkCallaghan, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D24705
      28c82ff1
    • I
      Turn on -Wshadow · 5c930905
      Igor Canadi 提交于
      Summary:
      Only one more try, I promise.
      
      I talked to Jim and he mentioned that if we include our system includes with -isystem rather than with -I, that signals to the compile that those are system includes and thus no warnings are issued. So I turned our glibc includes into system includes and now we no longer get the warning from there, making us shadow-warning-free!
      
      Test Plan: compiles with both clang and gcc
      
      Reviewers: sdong, yhchiang, rven, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28479
      5c930905
  14. 07 11月, 2014 2 次提交
    • I
      Turn off -Wshadow · 5fd33d26
      Igor Canadi 提交于
      Summary:
      So glibc is not -Wshadow-safe, so we need to turn it off :(
      
            error: ‘int sigaction(int, const sigaction*, sigaction*)’ hides
            constructor for ‘struct sigaction’
      
      The rest of the changes in this diff is that we include .h files under rocksdb namespace, which is a no-no.
      
      Test Plan: compiles now
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28413
      5fd33d26
    • I
      Turn -Wshadow back on · 9f20395c
      Igor Canadi 提交于
      Summary: It turns out that -Wshadow has different rules for gcc than clang. Previous commit fixed clang. This commits fixes the rest of the warnings for gcc.
      
      Test Plan: compiles
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28131
      9f20395c
  15. 01 11月, 2014 5 次提交
    • L
      introduce TestMemEnv and use it in db_test · 0e526eb9
      Lei Jin 提交于
      Summary:
      TestMemEnv simulates all Env APIs using in-memory data structures.
      We can use it to speed up db_test run, which is now reduced ~7mins when it is
      enabled.
      We can also add features to simulate power/disk failures in the next
      step
      TestMemEnv is derived from helper/mem_env
      mem_env can not be used for rocksdb since some of its APIs do not give
      the same results as env_posix. And its file read/write is not thread safe
      
      Test Plan:
      make all -j32
      ./db_test
      ./env_mem_test
      
      Reviewers: sdong, yhchiang, rven, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28035
      0e526eb9
    • L
      fix c_test · 82e3ae54
      Lei Jin 提交于
      Summary: as title
      
      Test Plan: ./c_test
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28119
      82e3ae54
    • L
      temporarily remove -Wshadow · 29d83cc3
      Lei Jin 提交于
      29d83cc3
    • I
      Turn on -Wshadow · 9f7fc3ac
      Igor Canadi 提交于
      Summary:
      ...and fix all the errors :)
      
      Jim suggested turning on -Wshadow because it helped him fix number of critical bugs in fbcode. I think it's a good idea to be -Wshadow clean.
      
      Test Plan: compiles
      
      Reviewers: yhchiang, rven, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27711
      9f7fc3ac
    • S
      Make VersionBuilder unit testable · 4d2ba38b
      sdong 提交于
      Summary:
      Rename Version::Builder to VersionBuilder and expose its definition to a header.
      Make VerisonBuilder not reference Version or ColumnFamilyData, only working with VersionStorageInfo.
      Add version_builder_test which has a simple test.
      
      Test Plan: make all check
      
      Reviewers: rven, yhchiang, igor, ljin
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D27969
      4d2ba38b
  16. 30 10月, 2014 3 次提交
    • I
      WalManager · 63590548
      Igor Canadi 提交于
      Summary: Decoupling code that deals with archived log files outside of DBImpl. That will make this code easier to reason about and test. It will also make the code easier to improve, because an improver doesn't have to understand DBImpl code in entirety.
      
      Test Plan: added test
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27873
      63590548
    • S
      Add ComparatorDBTest to test non-default comparators · 86de2007
      sdong 提交于
      Summary:
      Add some helper functions to make sure DB works well for non-default comparators.
      Add a test for SimpleSuffixReverseComparator.
      
      Test Plan: Run the new test
      
      Reviewers: ljin, rven, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D27831
      86de2007
    • S
      Make CompactionPicker more easily tested · 76d1c28e
      sdong 提交于
      Summary:
      Make compaction picker easier to test.
      The basic idea is to separate a minimum subcomponent of Version to VersionStorageInfo, which just responsible to LSM tree. A stub VersionStorageInfo can then be easily created and passed into compaction picker so that we can check the outputs.
      
      It now passes most tests. Still two things need to be done:
      (1) deal with the FIFO compaction's file size.
      (2) write an example test to make sure the interface can do the job.
      
      Add a compaction_picker_test to make sure compaction picker codes can be easily unit tested.
      
      Test Plan:
      Pass all unit tests and compaction_picker_test
      
      Reviewers: yhchiang, rven, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D27639
      76d1c28e
  17. 29 10月, 2014 2 次提交
    • I
      TableMock + framework for mock classes · abac3d64
      Igor Canadi 提交于
      Summary:
      This diff replaces BlockBasedTable in flush_job_test with TableMock, making it depend on less things and making it closer to an unit test than integration test.
      
      It also introduces a framework to compile mock classes -- Any file named *mock.cc will not be compiled into the build. It will only get compiled into the tests. What way we can mock out most other classes, Version, VersionSet, DBImpl, etc.
      
      Test Plan: flush_job_test
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27681
      abac3d64
    • I
      FlushProcess · a39e931e
      Igor Canadi 提交于
      Summary:
      Abstract out FlushProcess and take it out of DBImpl.
      This also includes taking DeletionState outside of DBImpl.
      
      Currently this diff is only doing the refactoring. Future work includes:
      1. Decoupling flush_process.cc, make it depend on less state
      2. Write flush_process_test, which will mock out everything that FlushProcess depends on and test it in isolation
      
      Test Plan: make check
      
      Reviewers: rven, yhchiang, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27561
      a39e931e
  18. 23 10月, 2014 1 次提交
  19. 06 10月, 2014 1 次提交
  20. 03 10月, 2014 8 次提交