1. 08 11月, 2014 10 次提交
    • I
      Get rid of mutex in CompactionJob's state · e3d3567b
      Igor Canadi 提交于
      Summary: Based on @sdong's feedback in the diff, we shouldn't keep db_mutex in CompactionJob's state. This diff removes db_mutex from CompactionJob state, by making next_file_number_ atomic. That way we only need to pass the lock to InstallCompactionResults() because of LogAndApply()
      
      Test Plan: make check
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: sdong, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28491
      e3d3567b
    • Y
      Fixed the shadowing in db/compaction.cc and include/rocksdb/db.h · 344edbb0
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the shadowing in db/compaction.cc and include/rocksdb/db.h
      
      Test Plan:
      make
      344edbb0
    • Y
      Fixed compile error in db/db_impl.cc · b8b39034
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed compile error in db/db_impl.cc
      
      Test Plan:
      make
      b8b39034
    • Y
      Fixed compile error in db/flush_job.cc · b622ba5d
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed compile error in db/flush_job.cc
      
      Test Plan:
      make
      b622ba5d
    • Y
      Fixed compile error in db/compaction.cc and db/compaction_picker.cc · 642ac9d8
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed compile error in db/compaction.cc and db/compaction_picker.cc
      
      Test Plan:
      make
      642ac9d8
    • I
      Fix -Wshadow for tools · 68effa03
      Igor Canadi 提交于
      Summary: Previously I made `make check` work with -Wshadow, but there are some tools that are not compiled using `make check`.
      
      Test Plan: make all
      
      Reviewers: yhchiang, rven, ljin, sdong
      
      Reviewed By: ljin, sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28497
      68effa03
    • Y
      Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h · 84478618
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h
      
      Test Plan:
      make
      84478618
    • 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
      Fix compile · a0f887c9
      Igor Canadi 提交于
      a0f887c9
    • I
      Redesign pending_outputs_ · 53af5d87
      Igor Canadi 提交于
      Summary:
      Here's a prototype of redesigning pending_outputs_. This way, we don't have to expose pending_outputs_ to other classes (CompactionJob, FlushJob, MemtableList). DBImpl takes care of it.
      
      Still have to write some comments, but should be good enough to start the discussion.
      
      Test Plan: make check, will also run stress test
      
      Reviewers: ljin, sdong, rven, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28353
      53af5d87
  2. 07 11月, 2014 7 次提交
  3. 06 11月, 2014 2 次提交
    • S
      Add db_bench option --report_file_operations · ea18b944
      Shi Feng 提交于
      Summary: Add db_bench option --report_file_operations
      
      Test Plan:
      ./db_bench --report_file_operations
      Observe outputs on # of file operations
      
      Reviewers: ljin, MarkCallaghan, sdong
      
      Reviewed By: sdong
      
      Subscribers: yhchiang, rven, igor, dhruba
      
      Differential Revision: https://reviews.facebook.net/D27945
      ea18b944
    • S
      Fix RecordIn and RecordDrop stats · 2ea1219e
      sdong 提交于
      Summary:
      1. fix possible overflow of the two stats by using uint64_t
      2. use a similar source of data to calculate RecordDrop. Previous one is not correct.
      
      Test Plan: See outputs of db_bench settings, and the results look reasonable
      
      Reviewers: MarkCallaghan, ljin, igor
      
      Reviewed By: igor
      
      Subscribers: rven, leveldb, yhchiang, dhruba
      
      Differential Revision: https://reviews.facebook.net/D28155
      2ea1219e
  4. 05 11月, 2014 9 次提交
  5. 04 11月, 2014 1 次提交
    • S
      DB::Open() to automatically increase thread pool size if it is smaller than... · 09899f0b
      sdong 提交于
      DB::Open() to automatically increase thread pool size if it is smaller than max number of parallel compactions or flushes
      
      Summary:
      With the patch, thread pool size will be automatically increased if DB's options ask for more parallelism of compactions or flushes.
      
      Too many users have been confused by the API. Change it to make it harder for users to make mistakes
      
      Test Plan: Add two unit tests to cover the function.
      
      Reviewers: yhchiang, rven, igor, MarkCallaghan, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27555
      09899f0b
  6. 01 11月, 2014 9 次提交
    • S
      Move VersionBuilder logic to a separate .cc file · 86905e3c
      sdong 提交于
      Summary: Move all the logic of VersionBuilder to a separate .cc file
      
      Test Plan: make all check
      
      Reviewers: ljin, yhchiang, rven, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D28083
      86905e3c
    • I
      CompactionJob · 74eb4fbe
      Igor Canadi 提交于
      Summary:
      Long awaited CompactionJob class! Move most compaction-related things from DBImpl to CompactionJob, making CompactionJob easier to test and understand.
      
      Currently this is just replicating exactly the same functionality with as little as change as possible. As future work, we should:
      1. Add CompactionJob tests (I think I'll do that tomorrow)
      2. Reduce CompactionJob's state that it inherits from DBImpl
      3. Figure out how to do yielding to flush better. Currently I implemented a callback as we agreed yesterday, but I don't think it's a good long term solution.
      
      This reduces db_impl.cc from 5000+ LOC to 3400!
      
      Test Plan: make check, will add CompactionJob-specific tests, probably also move some tests from db_test to compaction_job_test
      
      Reviewers: rven, yhchiang, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27957
      74eb4fbe
    • 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
      unfriend DBImpl and InternalStats from VersionStorageInfo · 5594d446
      Lei Jin 提交于
      Summary: as title
      
      Test Plan: make release
      
      Reviewers: sdong, yhchiang, rven, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28053
      5594d446
    • 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
    • S
      CompactionStats to support larger value of RecordIn and RecordDrop · c645250e
      sdong 提交于
      Summary: now we use %8d for RecordIn and %10d for RecordDrop, which is far too small for some use cases. Extend both of them to %12d.
      
      Test Plan: run one test in db_test and see the LOG file.
      
      Reviewers: igor, MarkCallaghan, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D28041
      c645250e
    • S
      Fix BaseReferencedVersionBuilder's destructor order · f7e6c856
      sdong 提交于
      Summary: BaseReferencedVersionBuilder now unreference version before destructing VersionBuilder, which is wrong. Fix it.
      
      Test Plan:
      make all check
      valgrind test to tests that used to fail
      
      Reviewers: igor, yhchiang, rven, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D28101
      f7e6c856
    • 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
  7. 31 10月, 2014 2 次提交