1. 12 6月, 2015 1 次提交
  2. 02 6月, 2015 1 次提交
    • M
      more times in perf_context and iostats_context · ec7a9443
      Mike Kolupaev 提交于
      Summary:
      We occasionally get write stalls (>1s Write() calls) on HDD under read load. The following timers explain almost all of the stalls:
       - perf_context.db_mutex_lock_nanos
       - perf_context.db_condition_wait_nanos
       - iostats_context.open_time
       - iostats_context.allocate_time
       - iostats_context.write_time
       - iostats_context.range_sync_time
       - iostats_context.logger_time
      
      In my experiments each of these occasionally takes >1s on write path under some workload. There are rare cases when Write() takes long but none of these takes long.
      
      Test Plan: Added code to our application to write the listed timings to log for slow writes. They usually add up to almost exactly the time Write() call took.
      
      Reviewers: rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: march, dhruba, tnovak
      
      Differential Revision: https://reviews.facebook.net/D39177
      ec7a9443
  3. 19 5月, 2015 1 次提交
  4. 24 4月, 2015 1 次提交
    • S
      Build for CYGWIN · 98a44559
      sdong 提交于
      Summary:
      Make it build for CYGWIN.
      Need to define "-std=gnu++11" instead of "-std=c++11" and use some replacement functions.
      
      Test Plan: Build it and run some unit tests in CYGWIN
      
      Reviewers: yhchiang, rven, anthony, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37605
      98a44559
  5. 19 3月, 2015 1 次提交
    • I
      Using chrono as a fallback · 155d468c
      Islam AbdelRahman 提交于
      Summary:
      Right now if they system we are compiling on is not Linux and not Mac we will get a compilation error
      this diff use chrono as a fallback when we are compiling on something other than Linux/FreeBSD/Mac
      
      Test Plan:
      compile on CentOS/FreeBSD
      ./db_test (still running)
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D35277
      155d468c
  6. 17 3月, 2015 2 次提交
    • D
      util/env_posix.cc: fix #elif check for __MACH__ · 87c7d49d
      Danny Al-Gaaf 提交于
      Fix '#elif with no expression' add defined() to check.
      Signed-off-by: NDanny Al-Gaaf <danny.al-gaaf@bisect.de>
      87c7d49d
    • V
      Speed up rocksDB close call. · b2b30865
      Venkatesh Radhakrishnan 提交于
      Summary:
      On RocksDB, when there are multiple instances doing
      flushes/compactions in the background, the close call takes a long time
      because the flushes/compactions need to complete before the database can
      shut down. If another instance is using the background threads and the compaction for this instance is in the queue since it has been scheduled, we still cannot shutdown. We now remove the scheduled background tasks which have not yet started running, so that shutdown is speeded up.
      
      Test Plan: DB Test added.
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33741
      b2b30865
  7. 04 3月, 2015 1 次提交
    • I
      Revert chrono use · b8d23cdc
      Igor Canadi 提交于
      Summary:
      For some reason, libstdc++ implements steady_clock::now() using syscall instead of VDSO optimized clock_gettime() when using glibc 2.16 and earlier. This leads to significant performance degradation for users with older glibcs. See bug reported here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59177
      
      We observed this behavior when testing mongo on AWS hosts. Facebook hosts are unaffected since we use glibc2.17 and 2.20.
      
      Revert "Fix timing"
      This reverts commit 965d9d50.
      
      Revert "Use chrono for timing"
      This reverts commit 001ce64d.
      
      Test Plan: make check
      
      Reviewers: MarkCallaghan, yhchiang, rven, meyering, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34371
      b8d23cdc
  8. 27 2月, 2015 1 次提交
    • I
      rocksdb: Add missing override · 62247ffa
      Igor Sugak 提交于
      Summary:
      When using latest clang (3.6 or 3.7/trunck) rocksdb is failing with many errors. Almost all of them are missing override errors. This diff adds missing override keyword. No manual changes.
      
      Prerequisites: bear and clang 3.5 build with extra tools
      
      ```lang=bash
      % USE_CLANG=1 bear make all # generate a compilation database http://clang.llvm.org/docs/JSONCompilationDatabase.html
      % clang-modernize -p . -include . -add-override
      % make format
      ```
      
      Test Plan:
      Make sure all tests are passing.
      ```lang=bash
      % #Use default fb code clang.
      % make check
      ```
      Verify less error and no missing override errors.
      ```lang=bash
      % # Have trunk clang present in path.
      % ROCKSDB_NO_FBCODE=1 CC=clang CXX=clang++ make
      ```
      
      Reviewers: igor, kradhakrishnan, rven, meyering, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34077
      62247ffa
  9. 18 2月, 2015 1 次提交
  10. 02 2月, 2015 1 次提交
  11. 31 12月, 2014 1 次提交
    • Y
      Add structures for exposing thread events and operations. · bf287b76
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add structures for exposing events and operations.  Event describes
      high-level action about a thread such as doing compaciton or
      doing flush, while an operation describes lower-level action
      of a thread such as reading / writing a SST table, waiting for
      mutex.  Events and operations are designed to be independent.
      One thread would typically involve in one event and one operation.
      
      Code instrument will be in a separate diff.
      
      Test Plan:
      Add unit-tests in thread_list_test
      make dbg -j32
      ./thread_list_test
      export ROCKSDB_TESTS=ThreadList
      ./db_test
      
      Reviewers: ljin, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: rven, jonahcohen, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D29781
      bf287b76
  12. 23 12月, 2014 1 次提交
    • Y
      Move GetThreadList() feature under Env. · 45bab305
      Yueh-Hsuan Chiang 提交于
      Summary:
      GetThreadList() feature depends on the thread creation and destruction, which is currently handled under Env.
      This patch moves GetThreadList() feature under Env to better manage the dependency of GetThreadList() feature
      on thread creation and destruction.
      
      Renamed ThreadStatusImpl to ThreadStatusUpdater.  Add ThreadStatusUtil, which is a static class contains
      utility functions for ThreadStatusUpdater.
      
      Test Plan: run db_test, thread_list_test and db_bench and verify the life cycle of Env and ThreadStatusUpdater is properly managed.
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: ljin, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D30057
      45bab305
  13. 18 12月, 2014 1 次提交
  14. 10 12月, 2014 1 次提交
    • I
      Fix #434 · cb82d7b0
      Igor Canadi 提交于
      Summary: Why do we assert here? This doesn't seem like user friendly thing to do :)
      
      Test Plan: none
      
      Reviewers: sdong, yhchiang, rven
      
      Reviewed By: rven
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D30027
      cb82d7b0
  15. 26 11月, 2014 1 次提交
  16. 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
  17. 15 11月, 2014 1 次提交
  18. 14 11月, 2014 1 次提交
  19. 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
  20. 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
  21. 30 10月, 2014 2 次提交
  22. 25 10月, 2014 2 次提交
    • I
      Fix timing · 965d9d50
      Igor Canadi 提交于
      965d9d50
    • I
      Use chrono for timing · 001ce64d
      Igor Canadi 提交于
      Summary: Since we depend on C++11, we might as well use it for timing, instead of this platform-depended code.
      
      Test Plan: Ran autovector_test, which reports time and confirmed that output is similar to master
      
      Reviewers: ljin, sdong, yhchiang, rven, dhruba
      
      Reviewed By: dhruba
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D25587
      001ce64d
  23. 30 8月, 2014 1 次提交
    • L
      limit max bytes that can be read/written per pread/write syscall · 7e9f28cb
      Lei Jin 提交于
      Summary:
      BlockBasedTable sst file size can grow to a large size when universal
      compaction is used. When index block exceeds 2G, pread seems to fail and
      return truncated data and causes "trucated block" error. I tried to use
      ```
        #define _FILE_OFFSET_BITS 64
      ```
      But the problem still persists. Splitting a big write/read into smaller
      batches seems to solve the problem.
      
      Test Plan:
      successfully compacted a case with resulting sst file at ~90G (2.1G
      index block size)
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D22569
      7e9f28cb
  24. 27 8月, 2014 1 次提交
  25. 14 8月, 2014 2 次提交
  26. 09 7月, 2014 1 次提交
    • L
      integrate rate limiter into rocksdb · 534357ca
      Lei Jin 提交于
      Summary:
      Add option and plugin rate limiter for PosixWritableFile. The rate
      limiter only applies to flush and compaction. WAL and MANIFEST are
      excluded from this enforcement.
      
      Test Plan: db_test
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19425
      534357ca
  27. 04 7月, 2014 1 次提交
  28. 02 7月, 2014 1 次提交
  29. 30 5月, 2014 1 次提交
  30. 22 5月, 2014 1 次提交
  31. 20 5月, 2014 2 次提交
    • S
      Print out thread ID while thread terminates for decreased pool size. · bd1105aa
      sdong 提交于
      Summary: Per request from @nkg-, temporarily print thread ID when a thread terminates. It is a temp solution as we try to minimized stderr messages.
      
      Test Plan: env_test
      
      Reviewers: haobo, igor, dhruba
      
      Reviewed By: igor
      
      CC: nkg-, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18753
      bd1105aa
    • S
      ThreadPool to allow decrease number of threads and increase of number of... · 3df07d17
      sdong 提交于
      ThreadPool to allow decrease number of threads and increase of number of threads is to be instantly scheduled
      
      Summary:
      Add a feature to decrease the number of threads in thread pool.
      Also instantly schedule more threads if number of threads is increased.
      
      Here is the way it is implemented: each background thread needs its thread ID. After decreasing number of threads, all threads are woken up. The thread with the largest thread ID will terminate. If there are more threads to terminate, the thread will wake up all threads again.
      
      Another change is made so that when number of threads is increased, more threads are created and all previous excessive threads are woken up to do the work.
      
      Test Plan: Add a unit test.
      
      Reviewers: haobo, dhruba
      
      Reviewed By: haobo
      
      CC: yhchiang, igor, nkg-, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18675
      3df07d17
  32. 29 4月, 2014 1 次提交
    • I
      Fix TransactionLogIterator EOF caching · 72ff275e
      Igor Canadi 提交于
      Summary:
      When TransactionLogIterator comes to EOF, it calls UnmarkEOF and continues reading. However, if glibc cached the EOF status of the file, it will get EOF again, even though the new data might have been written to it.
      
      This has been causing errors in Mac OS.
      
      Test Plan: test passes, was failing before
      
      Reviewers: dhruba, haobo, sdong
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18381
      72ff275e
  33. 22 4月, 2014 1 次提交
    • I
      Flush before Fsync()/Sync() · c2da9e59
      Igor Canadi 提交于
      Summary: Calling Fsync()/Sync() on a file should give the guarantee that whatever you written to the file is now persisted. This is currently not the case, since we might have some data left in application cache as we do Fsync()/Sync(). For example, BuildTable() calls Fsync() without the flush, assuming all sst data is now persisted, but it's actually not. This may result in big inconsistencies.
      
      Test Plan: no test
      
      Reviewers: sdong, dhruba, haobo, ljin, yhchiang
      
      Reviewed By: sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18159
      c2da9e59
  34. 02 4月, 2014 1 次提交
  35. 01 4月, 2014 1 次提交
    • I
      Retry FS system calls on EINTR · 726c8084
      Igor Canadi 提交于
      Summary: EINTR means 'please retry'. We don't do that currenty. We should.
      
      Test Plan: make check, although it doesn't really test the new code. we'll just have to believe in the code!
      
      Reviewers: haobo, ljin
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17349
      726c8084