1. 21 10月, 2017 1 次提交
  2. 20 10月, 2017 1 次提交
    • S
      Make FIFO compaction options dynamically configurable · f0804db7
      Sagar Vemuri 提交于
      Summary:
      ColumnFamilyOptions::compaction_options_fifo and all its sub-fields can be set dynamically now.
      
      Some of the ways in which the fifo compaction options can be set are:
      - `SetOptions({{"compaction_options_fifo", "{max_table_files_size=1024}"}})`
      - `SetOptions({{"compaction_options_fifo", "{ttl=600;}"}})`
      - `SetOptions({{"compaction_options_fifo", "{max_table_files_size=1024;ttl=600;}"}})`
      - `SetOptions({{"compaction_options_fifo", "{max_table_files_size=51;ttl=49;allow_compaction=true;}"}})`
      
      Most of the code has been made generic enough so that it could be reused later to make universal options (and other such nested defined-types) dynamic with very few lines of parsing/serializing code changes.
      Introduced a few new functions like `ParseStruct`, `SerializeStruct` and `GetStringFromStruct`.
      The duplicate code in `GetStringFromDBOptions` and `GetStringFromColumnFamilyOptions` has been moved into `GetStringFromStruct`. So they become just simple wrappers now.
      Closes https://github.com/facebook/rocksdb/pull/3006
      
      Differential Revision: D6058619
      
      Pulled By: sagar0
      
      fbshipit-source-id: 1e8f78b3374ca5249bb4f3be8a6d3bb4cbc52f92
      f0804db7
  3. 06 10月, 2017 1 次提交
  4. 13 9月, 2017 1 次提交
  5. 31 8月, 2017 1 次提交
    • A
      Extend property map with compaction stats · 8a6708f5
      Artem Danilov 提交于
      Summary:
      This branch extends existing property map which keeps values in doubles to keep values in strings so that it can be used to provide wider range of properties. The immediate need for that is to provide IO stall stats in an easy parseable way to MyRocks which is also part of this branch.
      Closes https://github.com/facebook/rocksdb/pull/2794
      
      Differential Revision: D5717676
      
      Pulled By: Tema
      
      fbshipit-source-id: e34ba5b79ba774697f7b97ce1138d8fd55471b8a
      8a6708f5
  6. 16 8月, 2017 1 次提交
  7. 10 8月, 2017 1 次提交
    • A
      add VerifyChecksum() to db.h · 7848f0b2
      Aaron G 提交于
      Summary:
      We need a tool to check any sst file corruption in the db.
      It will check all the sst files in current version and read all the blocks (data, meta, index) with checksum verification. If any verification fails, the function will return non-OK status.
      Closes https://github.com/facebook/rocksdb/pull/2498
      
      Differential Revision: D5324269
      
      Pulled By: lightmark
      
      fbshipit-source-id: 6f8a272008b722402a772acfc804524c9d1a483b
      7848f0b2
  8. 29 7月, 2017 1 次提交
    • S
      Fix FIFO Compaction with TTL tests · ac748c57
      Sagar Vemuri 提交于
      Summary:
      - FIFOCompactionWithTTLTest was flaky when run in parallel earlier, and hence it was disabled. Fixed it now.
      - Also, faking sleep now instead of really sleeping to make tests more realistic by using TTLs like 1 hour and 1 day.
      Closes https://github.com/facebook/rocksdb/pull/2650
      
      Differential Revision: D5506038
      
      Pulled By: sagar0
      
      fbshipit-source-id: deb429a527f045e3e2c5138b547c3e8ac8586aa2
      ac748c57
  9. 22 7月, 2017 2 次提交
  10. 18 7月, 2017 1 次提交
    • S
      enable PinnableSlice for RowCache · 0655b585
      Sushma Devendrappa 提交于
      Summary:
      This patch enables using PinnableSlice for RowCache, changes include
      not releasing the cache handle immediately after lookup in TableCache::Get, instead pass a Cleanble function which does Cache::RleaseHandle.
      Closes https://github.com/facebook/rocksdb/pull/2492
      
      Differential Revision: D5316216
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: d2a684bd7e4ba73772f762e58a82b5f4fbd5d362
      0655b585
  11. 16 7月, 2017 1 次提交
  12. 08 7月, 2017 1 次提交
  13. 28 6月, 2017 1 次提交
    • S
      FIFO Compaction with TTL · 1cd45cd1
      Sagar Vemuri 提交于
      Summary:
      Introducing FIFO compactions with TTL.
      
      FIFO compaction is based on size only which makes it tricky to enable in production as use cases can have organic growth. A user requested an option to drop files based on the time of their creation instead of the total size.
      
      To address that request:
      - Added a new TTL option to FIFO compaction options.
      - Updated FIFO compaction score to take TTL into consideration.
      - Added a new table property, creation_time, to keep track of when the SST file is created.
      - Creation_time is set as below:
        - On Flush: Set to the time of flush.
        - On Compaction: Set to the max creation_time of all the files involved in the compaction.
        - On Repair and Recovery: Set to the time of repair/recovery.
        - Old files created prior to this code change will have a creation_time of 0.
      - FIFO compaction with TTL is enabled when ttl > 0. All files older than ttl will be deleted during compaction. i.e. `if (file.creation_time < (current_time - ttl)) then delete(file)`. This will enable cases where you might want to delete all files older than, say, 1 day.
      - FIFO compaction will fall back to the prior way of deleting files based on size if:
        - the creation_time of all files involved in compaction is 0.
        - the total size (of all SST files combined) does not drop below `compaction_options_fifo.max_table_files_size` even if the files older than ttl are deleted.
      
      This feature is not supported if max_open_files != -1 or with table formats other than Block-based.
      
      **Test Plan:**
      Added tests.
      
      **Benchmark results:**
      Base: FIFO with max size: 100MB ::
      ```
      svemuri@dev15905 ~/rocksdb (fifo-compaction) $ TEST_TMPDIR=/dev/shm ./db_bench --benchmarks=readwhilewriting --num=5000000 --threads=16 --compaction_style=2 --fifo_compaction_max_table_files_size_mb=100
      
      readwhilewriting :       1.924 micros/op 519858 ops/sec;   13.6 MB/s (1176277 of 5000000 found)
      ```
      
      With TTL (a low one for testing) ::
      ```
      svemuri@dev15905 ~/rocksdb (fifo-compaction) $ TEST_TMPDIR=/dev/shm ./db_bench --benchmarks=readwhilewriting --num=5000000 --threads=16 --compaction_style=2 --fifo_compaction_max_table_files_size_mb=100 --fifo_compaction_ttl=20
      
      readwhilewriting :       1.902 micros/op 525817 ops/sec;   13.7 MB/s (1185057 of 5000000 found)
      ```
      Example Log lines:
      ```
      2017/06/26-15:17:24.609249 7fd5a45ff700 (Original Log Time 2017/06/26-15:17:24.609177) [db/compaction_picker.cc:1471] [default] FIFO compaction: picking file 40 with creation time 1498515423 for deletion
      2017/06/26-15:17:24.609255 7fd5a45ff700 (Original Log Time 2017/06/26-15:17:24.609234) [db/db_impl_compaction_flush.cc:1541] [default] Deleted 1 files
      ...
      2017/06/26-15:17:25.553185 7fd5a61a5800 [DEBUG] [db/db_impl_files.cc:309] [JOB 0] Delete /dev/shm/dbbench/000040.sst type=2 #40 -- OK
      2017/06/26-15:17:25.553205 7fd5a61a5800 EVENT_LOG_v1 {"time_micros": 1498515445553199, "job": 0, "event": "table_file_deletion", "file_number": 40}
      ```
      
      SST Files remaining in the dbbench dir, after db_bench execution completed:
      ```
      svemuri@dev15905 ~/rocksdb (fifo-compaction)  $ ls -l /dev/shm//dbbench/*.sst
      -rw-r--r--. 1 svemuri users 30749887 Jun 26 15:17 /dev/shm//dbbench/000042.sst
      -rw-r--r--. 1 svemuri users 30768779 Jun 26 15:17 /dev/shm//dbbench/000044.sst
      -rw-r--r--. 1 svemuri users 30757481 Jun 26 15:17 /dev/shm//dbbench/000046.sst
      ```
      Closes https://github.com/facebook/rocksdb/pull/2480
      
      Differential Revision: D5305116
      
      Pulled By: sagar0
      
      fbshipit-source-id: 3e5cfcf5dd07ed2211b5b37492eb235b45139174
      1cd45cd1
  14. 06 6月, 2017 1 次提交
  15. 03 6月, 2017 1 次提交
    • S
      Improve write buffer manager (and allow the size to be tracked in block cache) · 95b0e89b
      Siying Dong 提交于
      Summary:
      Improve write buffer manager in several ways:
      1. Size is tracked when arena block is allocated, rather than every allocation, so that it can better track actual memory usage and the tracking overhead is slightly lower.
      2. We start to trigger memtable flush when 7/8 of the memory cap hits, instead of 100%, and make 100% much harder to hit.
      3. Allow a cache object to be passed into buffer manager and the size allocated by memtable can be costed there. This can help users have one single memory cap across block cache and memtable.
      Closes https://github.com/facebook/rocksdb/pull/2350
      
      Differential Revision: D5110648
      
      Pulled By: siying
      
      fbshipit-source-id: b4238113094bf22574001e446b5d88523ba00017
      95b0e89b
  16. 24 5月, 2017 1 次提交
    • A
      New API for background work in single thread pool · 6cc9aef1
      Andrew Kryczka 提交于
      Summary:
      Previously users could set `max_background_flushes=0` to force rocksdb to use a single thread pool for both background flushes and compactions. That'll no longer be possible since I'm going to deprecate `max_background_flushes` and `max_background_compactions` in favor of a single option. This diff introduces a new way to force a single thread pool: when high-pri pool has zero threads, all background jobs will be submitted to low-pri pool.
      
      Note the majority of the code change is adding `Env::GetBackgroundThreads()`, which is necessary to check whether the user has provided a zero-sized thread pool.
      Closes https://github.com/facebook/rocksdb/pull/2204
      
      Differential Revision: D4936256
      
      Pulled By: ajkr
      
      fbshipit-source-id: 929a07a0c0705f7766f5339cd013ff74e90d6e01
      6cc9aef1
  17. 05 5月, 2017 1 次提交
  18. 28 4月, 2017 1 次提交
  19. 27 4月, 2017 2 次提交
  20. 06 4月, 2017 1 次提交
  21. 04 4月, 2017 1 次提交
  22. 24 3月, 2017 1 次提交
  23. 23 3月, 2017 2 次提交
    • D
      Fix clang compile error - [-Werror,-Wunused-lambda-capture] · f4fce475
      Daniel Black 提交于
      Summary:
      Errors where:
      
      db/version_set.cc:1535:20: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
                        [this](const Fsize& f1, const Fsize& f2) -> bool {
                         ^
      db/version_set.cc:1541:20: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
                        [this](const Fsize& f1, const Fsize& f2) -> bool {
                         ^
      db/db_test.cc:2983:27: error: lambda capture 'kNumPutsBeforeWaitForFlush' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
        auto gen_l0_kb = [this, kNumPutsBeforeWaitForFlush](int size) {
                                ^
      Closes https://github.com/facebook/rocksdb/pull/1972
      
      Differential Revision: D4685991
      
      Pulled By: siying
      
      fbshipit-source-id: 9125379
      f4fce475
    • S
      Remove ASSERT_EQ(boolean, ...) · 15950fe3
      Siying Dong 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/2024
      
      Differential Revision: D4755420
      
      Pulled By: siying
      
      fbshipit-source-id: 7332ab1
      15950fe3
  24. 14 3月, 2017 1 次提交
    • M
      Pinnableslice (2nd attempt) · 11526252
      Maysam Yabandeh 提交于
      Summary:
      PinnableSlice
      
          Summary:
          Currently the point lookup values are copied to a string provided by the
          user. This incures an extra memcpy cost. This patch allows doing point lookup
          via a PinnableSlice which pins the source memory location (instead of
          copying their content) and releases them after the content is consumed
          by the user. The old API of Get(string) is translated to the new API
          underneath.
      
          Here is the summary for improvements:
      
          value 100 byte: 1.8% regular, 1.2% merge values
          value 1k byte: 11.5% regular, 7.5% merge values
          value 10k byte: 26% regular, 29.9% merge values
          The improvement for merge could be more if we extend this approach to
          pin the merge output and delay the full merge operation until the user
          actually needs it. We have put that for future work.
      
          PS:
          Sometimes we observe a small decrease in performance when switching from
          t5452014 to this patch but with the old Get(string) API. The d
      Closes https://github.com/facebook/rocksdb/pull/1756
      
      Differential Revision: D4391738
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 6f3edd3
      11526252
  25. 09 3月, 2017 3 次提交
  26. 04 3月, 2017 1 次提交
  27. 03 3月, 2017 1 次提交
    • A
      Statistic for how often rate limiter is drained · 7c80a6d7
      Andrew Kryczka 提交于
      Summary:
      This is the metric I plan to use for adaptive rate limiting. The statistics are updated only if the rate limiter is drained by flush or compaction. I believe (but am not certain) that this is the normal case.
      
      The Statistics object is passed in RateLimiter::Request() to avoid requiring changes to client code, which would've been necessary if we passed it in the RateLimiter constructor.
      Closes https://github.com/facebook/rocksdb/pull/1946
      
      Differential Revision: D4646489
      
      Pulled By: ajkr
      
      fbshipit-source-id: d8e0161
      7c80a6d7
  28. 28 2月, 2017 1 次提交
  29. 24 2月, 2017 2 次提交
  30. 18 2月, 2017 1 次提交
  31. 14 2月, 2017 1 次提交
    • S
      Remove disableDataSync option · eb912a92
      Sagar Vemuri 提交于
      Summary:
      Remove disableDataSync, and another similarly named disable_data_sync options.
      This is being done to simplify options, and also because the performance gains of this feature can be achieved by other methods.
      Closes https://github.com/facebook/rocksdb/pull/1859
      
      Differential Revision: D4541292
      
      Pulled By: sagar0
      
      fbshipit-source-id: 5b3a6ca
      eb912a92
  32. 07 2月, 2017 2 次提交
    • D
      Windows thread · 0a4cdde5
      Dmitri Smirnov 提交于
      Summary:
      introduce new methods into a public threadpool interface,
      - allow submission of std::functions as they allow greater flexibility.
      - add Joining methods to the implementation to join scheduled and submitted jobs with
        an option to cancel jobs that did not start executing.
      - Remove ugly `#ifdefs` between pthread and std implementation, make it uniform.
      - introduce pimpl for a drop in replacement of the implementation
      - Introduce rocksdb::port::Thread typedef which is a replacement for std::thread.  On Posix Thread defaults as before std::thread.
      - Implement WindowsThread that allocates memory in a more controllable manner than windows std::thread with a replaceable implementation.
      - should be no functionality changes.
      Closes https://github.com/facebook/rocksdb/pull/1823
      
      Differential Revision: D4492902
      
      Pulled By: siying
      
      fbshipit-source-id: c74cb11
      0a4cdde5
    • V
      Adding GetApproximateMemTableStats method · 1aaa898c
      Vitaliy Liptchinsky 提交于
      Summary:
      Added method that returns approx num of entries as well as size for memtables.
      Closes https://github.com/facebook/rocksdb/pull/1841
      
      Differential Revision: D4511990
      
      Pulled By: VitaliyLi
      
      fbshipit-source-id: 9a4576e
      1aaa898c
  33. 21 1月, 2017 1 次提交