1. 21 12月, 2018 1 次提交
    • S
      Introduce a CPU time counter in perf_context (#4741) · da1c64b6
      Siying Dong 提交于
      Summary:
      Introduce the first CPU timing counter, perf_context.get_cpu_nanos. This opens a door to more CPU counters in the future.
      Only Posix Env has it implemented using clock_gettime() with CLOCK_THREAD_CPUTIME_ID. How accurate the counter is depends on the platform.
      Make PerfStepTimer to take an Env as an argument, and sometimes pass it in. The direct reason is to make the unit tests to use SpecialEnv where we can ingest logic there. But in long term, this is a good change.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4741
      
      Differential Revision: D13287798
      
      Pulled By: siying
      
      fbshipit-source-id: 090361049d9d5095d1d1a369fe1338d2e2e1c73f
      da1c64b6
  2. 20 12月, 2018 4 次提交
  3. 19 12月, 2018 4 次提交
  4. 18 12月, 2018 6 次提交
  5. 15 12月, 2018 3 次提交
  6. 14 12月, 2018 6 次提交
    • A
      Refine db_stress params for atomic flush (#4781) · 8d2b74d2
      Andrew Kryczka 提交于
      Summary:
      Separate flag for enabling option from flag for enabling dedicated atomic stress test. I have found setting the former without setting the latter can detect different problems.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4781
      
      Differential Revision: D13463211
      
      Pulled By: ajkr
      
      fbshipit-source-id: 054f777885b2dc7d5ea99faafa21d6537eee45fd
      8d2b74d2
    • M
      Fix race condition on options_file_number_ (#4780) · 34954233
      Maysam Yabandeh 提交于
      Summary:
      options_file_number_ must be written under db::mutex_ sine its read is protected by mutex_ in ::GetLiveFiles(). However currently it is written in ::RenameTempFileToOptionsFile() which according to its contract must be called without holding db::mutex_. The patch fixes the race condition by also acquitting the mutex_ before writing options_file_number_. Also it does that only if the rename of option file is successful.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4780
      
      Differential Revision: D13461411
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 2d5bae96a1f3e969ef2505b737cf2d7ae749787b
      34954233
    • Y
      Improve flushing multiple column families (#4708) · 4fce44fc
      Yanqin Jin 提交于
      Summary:
      If one column family is dropped, we should simply skip it and continue to flush
      other active ones.
      Currently we use Status::ShutdownInProgress to notify caller of column families
      being dropped. In the future, we should consider using a different Status code.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4708
      
      Differential Revision: D13378954
      
      Pulled By: riversand963
      
      fbshipit-source-id: 42f248cdf2d32d4c0f677cd39012694b8f1328ca
      4fce44fc
    • M
      Reduce runtime of compact_on_deletion_collector_test (#4779) · 67e5b542
      Maysam Yabandeh 提交于
      Summary:
      It sometimes times out with it is run with TSAN. The patch reduces the iteration from 50 to 30. This reduces the normal runtime from 5.2 to 3.1 seconds and should similarly address the TSAN timeout problem.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4779
      
      Differential Revision: D13456862
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: fdc0ad7d781b1c33b771d2415ff5fa2f1b5e2537
      67e5b542
    • D
      Get `CompactionJobInfo` from CompactFiles · 2670fe8c
      DorianZheng 提交于
      Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4716
      
      Differential Revision: D13207677
      
      Pulled By: ajkr
      
      fbshipit-source-id: d0ccf5a66df6cbb07288b0c5ebad81fd9df3926b
      2670fe8c
    • B
      Concurrent task limiter for compaction thread control (#4332) · a8b9891f
      Burton Li 提交于
      Summary:
      The PR is targeting to resolve the issue of:
      https://github.com/facebook/rocksdb/issues/3972#issue-330771918
      
      We have a rocksdb created with leveled-compaction with multiple column families (CFs), some of CFs are using HDD to store big and less frequently accessed data and others are using SSD.
      When there are continuously write traffics going on to all CFs, the compaction thread pool is mostly occupied by those slow HDD compactions, which blocks fully utilize SSD bandwidth.
      Since atomic write and transaction is needed across CFs, so splitting it to multiple rocksdb instance is not an option for us.
      
      With the compaction thread control, we got 30%+ HDD write throughput gain, and also a lot smooth SSD write since less write stall happening.
      
      ConcurrentTaskLimiter can be shared with multi-CFs across rocksdb instances, so the feature does not only work for multi-CFs scenarios, but also for multi-rocksdbs scenarios, who need disk IO resource control per tenant.
      
      The usage is straight forward:
      e.g.:
      
      //
      // Enable compaction thread limiter thru ColumnFamilyOptions
      //
      std::shared_ptr<ConcurrentTaskLimiter> ctl(NewConcurrentTaskLimiter("foo_limiter", 4));
      Options options;
      ColumnFamilyOptions cf_opt(options);
      cf_opt.compaction_thread_limiter = ctl;
      ...
      
      //
      // Compaction thread limiter can be tuned or disabled on-the-fly
      //
      ctl->SetMaxOutstandingTask(12); // enlarge to 12 tasks
      ...
      ctl->ResetMaxOutstandingTask(); // disable (bypass) thread limiter
      ctl->SetMaxOutstandingTask(-1); // Same as above
      ...
      ctl->SetMaxOutstandingTask(0);  // full throttle (0 task)
      
      //
      // Sharing compaction thread limiter among CFs (to resolve multiple storage perf issue)
      //
      std::shared_ptr<ConcurrentTaskLimiter> ctl_ssd(NewConcurrentTaskLimiter("ssd_limiter", 8));
      std::shared_ptr<ConcurrentTaskLimiter> ctl_hdd(NewConcurrentTaskLimiter("hdd_limiter", 4));
      Options options;
      ColumnFamilyOptions cf_opt_ssd1(options);
      ColumnFamilyOptions cf_opt_ssd2(options);
      ColumnFamilyOptions cf_opt_hdd1(options);
      ColumnFamilyOptions cf_opt_hdd2(options);
      ColumnFamilyOptions cf_opt_hdd3(options);
      
      // SSD CFs
      cf_opt_ssd1.compaction_thread_limiter = ctl_ssd;
      cf_opt_ssd2.compaction_thread_limiter = ctl_ssd;
      
      // HDD CFs
      cf_opt_hdd1.compaction_thread_limiter = ctl_hdd;
      cf_opt_hdd2.compaction_thread_limiter = ctl_hdd;
      cf_opt_hdd3.compaction_thread_limiter = ctl_hdd;
      
      ...
      
      //
      // The limiter is disabled by default (or set to nullptr explicitly)
      //
      Options options;
      ColumnFamilyOptions cf_opt(options);
      cf_opt.compaction_thread_limiter = nullptr;
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4332
      
      Differential Revision: D13226590
      
      Pulled By: siying
      
      fbshipit-source-id: 14307aec55b8bd59c8223d04aa6db3c03d1b0c1d
      a8b9891f
  7. 13 12月, 2018 1 次提交
    • M
      Fix flaky test DBCompactionTest::DeleteFileRange (#4776) · 0aa17c10
      Maysam Yabandeh 提交于
      Summary:
      The test has been failing sporadically probably because the configured compaction options were actually unused. Verified that by the following:
      ```
      ~/gtest-parallel/gtest-parallel ./db_compaction_test --gtest_filter=DBCompactionTest.DeleteFileRange --repeat=1000
      ```
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4776
      
      Differential Revision: D13441052
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: d35075b9e6cef9b9c9d0d571f9cd72ade8eda55d
      0aa17c10
  8. 12 12月, 2018 7 次提交
  9. 11 12月, 2018 4 次提交
    • B
      Promote CompactionFilter* accessors to ColumnFamilyOptionsInterface (#3461) · 8261e002
      Ben Clay 提交于
      Summary:
      When adding CompactionFilter and CompactionFilterFactory settings to the Java layer, ColumnFamilyOptions was modified directly instead of ColumnFamilyOptionsInterface. This meant that the old-stye Options monolith was left behind.
      
      This patch fixes that, by:
      - promoting the CompactionFilter + CompactionFilterFactory setters from ColumnFamilyOptions -> ColumnFamilyOptionsInterface
      - adding getters in ColumnFamilyOptionsInterface
      - implementing setters in Options
      - implementing getters in both ColumnFamilyOptions and Options
      - adding testcases
      - reusing a test CompactionFilterFactory by moving it to a common location
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/3461
      
      Differential Revision: D13278788
      
      Pulled By: sagar0
      
      fbshipit-source-id: 72602c6eb97dc80734e718abb5e2e9958d3c753b
      8261e002
    • A
      Properly set smallest key of subcompaction output (#4723) · 64aabc91
      Abhishek Madan 提交于
      Summary:
      It is possible to see a situation like the following when
      subcompactions are enabled:
      1. A subcompaction boundary is set to `[b, e)`.
      2. The first output file in a subcompaction has `c@20` as its smallest key
      3. The range tombstone `[a, d)30` is encountered.
      4. The tombstone is written to the range-del meta block and the new
         smallest key is set to `b@0` (since no keys in this subcompaction's
         output can be smaller than `b`).
      5. A key `b@10` in a lower level will now reappear, since it is not
         covered by the truncated start key `b@0`.
      
      In general, unless the smallest data key in a file has a seqnum of 0, it
      is not safe to truncate a tombstone at the start key to have a seqnum of
      0, since it can expose keys with a seqnum greater than 0 but less than
      the tombstone's actual seqnum.
      
      To fix this, when the lower bound of a file is from the subcompaction
      boundaries, we now set the seqnum of an artificially extended smallest
      key to the tombstone's seqnum. This is safe because subcompactions
      operate over disjoint sets of keys, and the subcompactions that can
      experience this problem are not the first subcompaction (which is
      unbounded on the left).
      
      Furthermore, there is now an assertion to detect the described anomalous
      case.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4723
      
      Differential Revision: D13236188
      
      Pulled By: abhimadan
      
      fbshipit-source-id: a6da6a113f2de1e2ff307ca72e055300c8fe5692
      64aabc91
    • A
      Reduce javadoc warnings (#4764) · 10e7de77
      Adam Singer 提交于
      Summary:
      Compile logs have a bit of noise due to missing javadoc annotations. Updating docs to reduce.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4764
      
      Differential Revision: D13400193
      
      Pulled By: sagar0
      
      fbshipit-source-id: 65c7efb70747cc3bb35a336a6881ea6536ae5ff4
      10e7de77
    • M
      Fix inline comments for assumed_tracked (#4762) · 21fca397
      Maysam Yabandeh 提交于
      Summary:
      Fix the definition of assumed_tracked in Transaction that was introduced in #4680
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4762
      
      Differential Revision: D13399150
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 2a30fe49e3c44adacd7e45cd48eae95023ca9dca
      21fca397
  10. 08 12月, 2018 4 次提交