1. 15 1月, 2014 13 次提交
    • S
      [RocksDB Performance Branch] DBImpl.NewInternalIterator() to reduce works inside mutex · 9b51af5a
      Siying Dong 提交于
      Summary: To reduce mutex contention caused by DBImpl.NewInternalIterator(), in this function, move all the iteration creation works out of mutex, only leaving object ref and get.
      
      Test Plan:
      make all check
      will run db_stress for a while too to make sure no problem.
      
      Reviewers: haobo, dhruba, kailiu
      
      Reviewed By: haobo
      
      CC: igor, leveldb
      
      Differential Revision: https://reviews.facebook.net/D14589
      
      Conflicts:
      	db/db_impl.cc
      9b51af5a
    • I
      Fix CompactRange to apply filter to every key · d9cd7a06
      Igor Canadi 提交于
      Summary:
      When doing CompactRange(), we should first flush the memtable and then calculate max_level_with_files. Also, we want to compact all the levels that have files, including level `max_level_with_files`.
      
      This patch fixed the unit test.
      
      Test Plan: Added a failing unit test and a fix, so it's not failing anymore.
      
      Reviewers: dhruba, haobo, sdong
      
      Reviewed By: haobo
      
      CC: leveldb, xjin
      
      Differential Revision: https://reviews.facebook.net/D14421
      d9cd7a06
    • I
      1ed2404f
    • I
      Fix test · 62910202
      Igor Canadi 提交于
      62910202
    • I
      Fix memtable construction in tests · 7f3e417f
      Igor Canadi 提交于
      7f3e417f
    • I
      VersionEdit not to take NumLevels() · 055e6df4
      Igor Canadi 提交于
      Summary:
      I will submit a sequence of diffs that are preparing master branch for column families. There are a lot of implicit assumptions in the code that are making column family implementation hard. If I make the change only in column family branch, it will make merging back to master impossible.
      
      Most of the diffs will be simple code refactorings, so I hope we can have fast turnaround time. Feel free to grab me in person to discuss any of them.
      
      This diff removes number of level check from VersionEdit. It is used only when VersionEdit is read, not written, but has to be set when it is written. I believe it is a right thing to make VersionEdit dumb and check consistency on the caller side. This will also make it much easier to implement Column Families, since different column families can have different number of levels.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, sdong, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15159
      055e6df4
    • I
      BuildBatchGroup -- memcpy outside of lock · 7d9f21cf
      Igor Canadi 提交于
      Summary: When building batch group, don't actually build a new batch since it requires heavy-weight mem copy and malloc. Only store references to the batches and build the batch group without lock held.
      
      Test Plan:
      `make check`
      
      I am also planning to run performance tests. The workload that will benefit from this change is readwhilewriting. I will post the results once I have them.
      
      Reviewers: dhruba, haobo, kailiu
      
      Reviewed By: haobo
      
      CC: leveldb, xjin
      
      Differential Revision: https://reviews.facebook.net/D15063
      7d9f21cf
    • K
      Move the compilation of the shared libraries to "make release" · 481c77e5
      kailiu 提交于
      Compiling the shared libraries took a long time. Thus to speed up the development speed, it still makes sense to be separated from regular compilation.
      481c77e5
    • N
    • K
      A script that automatically reformat affected lines · d702d807
      Kai Liu 提交于
      Summary:
      Added a script that reformat only the affected lines in a given diff.
      
      I planned to make that file as pre-commit hook but looks it's a little bit more difficult than I thought. Since I don't want to spend too much time on this task right now, I eventually added a "make command" to achieve this with a few additional key strokes.
      
      Also make the clang-format solely inherited from Google's style -- there are still debates on some of the style issues, but we can address them later once we reach a consensus.
      
      Test Plan: Did some ugly format change and ran "make format", all affected lines are formatted as expected.
      
      Reviewers: igor, sdong, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15147
      d702d807
    • N
      Use sanitized options while opening db · 1d9bac4d
      Naman Gupta 提交于
      Summary: We use SanitizeOptions() to set appropriate values for some options, based on other options. So we should use the sanitized options by default. Luckily it hasn't caused a bug yet, but can result in a bug in the fugture.
      
      Test Plan: make check
      
      Reviewers: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14103
      1d9bac4d
    • S
      Pre-calculate whether to slow down for too many level 0 files · fbbf0d14
      Siying Dong 提交于
      Summary: Currently in DBImpl::MakeRoomForWrite(), we do  "versions_->NumLevelFiles(0) >= options_.level0_slowdown_writes_trigger" to check whether the writer thread needs to slow down. However, versions_->NumLevelFiles(0) is slightly more expensive than we expected. By caching the result of the comparison when installing a new version, we can avoid this function call every time.
      
      Test Plan:
      make all check
      Manually trigger this behavior by applying universal compaction style and make sure inserts are made slow after there are certain number of files.
      
      Reviewers: haobo, kailiu, igor
      
      Reviewed By: kailiu
      
      CC: nkg-, leveldb
      
      Differential Revision: https://reviews.facebook.net/D15141
      fbbf0d14
    • S
      DB::Put() to estimate write batch data size needed and pre-allocate buffer · 51dd2192
      Siying Dong 提交于
      Summary:
      In one of CPU profiles, we see some CPU costs of string::reserve() inside Batch.Put(). This patch should be able to reduce some of the costs by allocating sufficient buffer before hand.
      
      Since it is a trivial percentage of CPU costs, I didn't find a way to show the improvement in one of the benchmarks. I'll deploy it to same application and do the same CPU profiling to make sure those CPU costs are reduced.
      
      Test Plan: make all check
      
      Reviewers: haobo, kailiu, igor
      
      Reviewed By: haobo
      
      CC: leveldb, nkg-
      
      Differential Revision: https://reviews.facebook.net/D15135
      51dd2192
  2. 14 1月, 2014 2 次提交
    • K
      Compile dynamic library by default · ac2fe728
      kailiu 提交于
      Summary:
      Per request, some users need to use dynamic rocksdb library instead of static one.
      
      However currently the dynamic libraries have to be manually compiled by default, which is inconvenient. I made dymamic libraries to be compiled by default.
      
      Test Plan: make clean; make; make clean;
      
      Reviewers: haobo, sdong, dhruba, igor
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15117
      ac2fe728
    • S
      WriteBatch to provide a way for user to query data size directly and only... · c4548d5f
      Siying Dong 提交于
      WriteBatch to provide a way for user to query data size directly and only return constant reference of data in Data()
      
      Summary:
      WriteBatch::Data() now is easily to be misuse by users. Also, there is no cheap way for user of WriteBatch to know the data size accumulated. This patch fix the problem by:
      (1) return a constant reference to Data() so it's obvious to caller what it means.
      (2) add a function to return data size directly
      
      Test Plan: make all check
      
      Reviewers: haobo, igor, kailiu
      
      Reviewed By: kailiu
      
      CC: zshao, leveldb
      
      Differential Revision: https://reviews.facebook.net/D15123
      c4548d5f
  3. 12 1月, 2014 1 次提交
  4. 11 1月, 2014 4 次提交
  5. 10 1月, 2014 2 次提交
    • Y
      fix compile warning · afdd2d1a
      Yancey 提交于
      afdd2d1a
    • I
      Feature requests for BackupableDB · cb37ddf2
      Igor Canadi 提交于
      Summary:
      This diff introduces some features that were requested by two internal customers:
      * Ability for backups not to share table files, because we can't guarantee that equal filename means equal content accross replicas
      * Ability for two threads to call EnableFileDeletions() and DisableFileDeletions()
      * Ability to stop backup from another thread and not slow down the DB close
      * Copy the files to the temporary folder first and then atomically rename
      
      Test Plan: Added some tests to backupable_db_test
      
      Reviewers: dhruba, sanketh, muthu, sdong, haobo
      
      Reviewed By: haobo
      
      CC: leveldb, sanketh, muthu
      
      Differential Revision: https://reviews.facebook.net/D14769
      cb37ddf2
  6. 09 1月, 2014 3 次提交
  7. 08 1月, 2014 3 次提交
    • M
      Don't always compress L0 files written by memtable flush · 50994bf6
      Mark Callaghan 提交于
      Summary:
      Code was always compressing L0 files written by a memtable flush
      when compression was enabled. Now this is done when
      min_level_to_compress=0 for leveled compaction and when
      universal_compaction_size_percent=-1 for universal compaction.
      
      Task ID: #3416472
      
      Blame Rev:
      
      Test Plan:
      ran db_bench with compression options
      
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: dhruba, igor, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14757
      50994bf6
    • I
      Merge pull request #59 from mlin/more-c-bindings · a45b7d83
      Igor Canadi 提交于
      C API: add rocksdb_env_set_high_priority_background_threads
      a45b7d83
    • T
      Fix a deadlock in CompactRange() · 9f690ec6
      Tomislav Novak 提交于
      Summary:
      The way DBImpl::TEST_CompactRange() throttles down the number of bg compactions
      can cause it to deadlock when CompactRange() is called concurrently from
      multiple threads. Imagine a following scenario with only two threads
      (max_background_compactions is 10 and bg_compaction_scheduled_ is initially 0):
      
         1. Thread #1 increments bg_compaction_scheduled_ (to LargeNumber), sets
            bg_compaction_scheduled_ to 9 (newvalue), schedules the compaction
            (bg_compaction_scheduled_ is now 10) and waits for it to complete.
         2. Thread #2 calls TEST_CompactRange(), increments bg_compaction_scheduled_
            (now LargeNumber + 10) and waits on a cv for bg_compaction_scheduled_ to
            drop to LargeNumber.
         3. BG thread completes the first manual compaction, decrements
            bg_compaction_scheduled_ and wakes up all threads waiting on bg_cv_.
            Thread #1 runs, increments bg_compaction_scheduled_ by LargeNumber again
            (now 2*LargeNumber + 9). Since that's more than LargeNumber + newvalue,
            thread #2 also goes to sleep (waiting on bg_cv_), without resetting
            bg_compaction_scheduled_.
      
      This diff attempts to address the problem by introducing a new counter
      bg_manual_only_ (when positive, MaybeScheduleFlushOrCompaction() will only
      schedule manual compactions).
      
      Test Plan:
      I could pretty much consistently reproduce the deadlock with a program that
      calls CompactRange(nullptr, nullptr) immediately after Write() from multiple
      threads. This no longer happens with this patch.
      
      Tests (make check) pass.
      
      Reviewers: dhruba, igor, sdong, haobo
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14799
      9f690ec6
  8. 07 1月, 2014 3 次提交
  9. 06 1月, 2014 1 次提交
  10. 05 1月, 2014 1 次提交
  11. 03 1月, 2014 3 次提交
    • K
      Add clang-format rules · 463086bc
      Kai Liu 提交于
      Summary:
      The rule file is forked from that in Facebook's repo.
      
      I'll add format file for now and team members can tune the rules later.
      
      In this patch, I made only two changes in order to be consistent with existing coding style
      
      `SpacesBeforeTrailingComments: 2`
      
      `ColumnLimit:     80`
      
      Test Plan: N/A
      
      Reviewers: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15015
      463086bc
    • K
      Automate the preparation step for a new release · 46950597
      Kai Liu 提交于
      Summary: Added a script that prepares the repo for facebook's new rocksdb release, which will automatically do some necessary work to make sure this repo is ready for 3rdparty release.
      
      Test Plan:
      Run this script and observed:
      
      * new version was created (both in local and remote repo) as a git tag.
      * build_version.cc was updated
      * build_detect_platform was changed so that it won't create any new change.
      
      Reviewers: haobo, dhruba, sdong, igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15003
      46950597
    • K
      Hotfix the bug in table cache's GetSliceForFileNumber · 9281a826
      kailiu 提交于
      Forgot to fix this problem in master branch. Already fixed it in performance branch.
      9281a826
  12. 02 1月, 2014 4 次提交