1. 06 7月, 2016 2 次提交
    • A
      group multiple batch of flush into one manifest file (one call to LogAndApply) · 5aaef91d
      Aaron Gao 提交于
      Summary: Currently, if several flush outputs are committed together, we issue each manifest write per batch (1 batch = 1 flush = 1 sst file = 1+ continuous memtables). Each manifest write requires one fsync and one fsync to parent directory. In some cases, it becomes the bottleneck of write. We should batch them and write in one manifest write when possible.
      
      Test Plan:
      ` ./db_bench -benchmarks="fillseq" -max_write_buffer_number=16 -max_background_flushes=16 -disable_auto_compactions=true -min_write_buffer_number_to_merge=1 -write_buffer_size=65536 -level0_stop_writes_trigger=10000 -level0_slowdown_writes_trigger=10000`
      **Before**
      ```
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      RocksDB:    version 4.9
      Date:       Fri Jul  1 15:38:17 2016
      CPU:        32 * Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
      CPUCache:   20480 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      Prefix:    0 bytes
      Keys per prefix:    0
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Write rate: 0 bytes/second
      Compression: Snappy
      Memtablerep: skip_list
      Perf Level: 1
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :     166.277 micros/op 6014 ops/sec;    0.7 MB/s
      ```
      **After**
      ```
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      RocksDB:    version 4.9
      Date:       Fri Jul  1 15:35:05 2016
      CPU:        32 * Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
      CPUCache:   20480 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      Prefix:    0 bytes
      Keys per prefix:    0
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Write rate: 0 bytes/second
      Compression: Snappy
      Memtablerep: skip_list
      Perf Level: 1
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :      52.328 micros/op 19110 ops/sec;    2.1 MB/s
      ```
      
      Reviewers: andrewkr, IslamAbdelRahman, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: igor, andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60075
      5aaef91d
    • O
      Fix a bug that accesses invalid address in iterator cleanup function · a45ee831
      omegaga 提交于
      Summary: Reported in T11889874. When registering the cleanup function we should copy the option so that we can still access it if ReadOptions is deleted.
      
      Test Plan: Add a unit test to reproduce this bug.
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60087
      a45ee831
  2. 05 7月, 2016 2 次提交
  3. 02 7月, 2016 3 次提交
  4. 01 7月, 2016 4 次提交
    • A
      fix rate limiter to avoid starvation · cb2476a0
      Aaron Gao 提交于
      Summary:
      The current implementation of rate limiter has the possibility to introduce resource starvation when change its limit.
      This diff aims to fix this problem by consuming request bytes partially.
      
      Test Plan:
      ```
      ./rate_limiter_test
      [==========] Running 4 tests from 1 test case.
      [----------] Global test environment set-up.
      [----------] 4 tests from RateLimiterTest
      [ RUN      ] RateLimiterTest.OverflowRate
      [       OK ] RateLimiterTest.OverflowRate (0 ms)
      [ RUN      ] RateLimiterTest.StartStop
      [       OK ] RateLimiterTest.StartStop (0 ms)
      [ RUN      ] RateLimiterTest.Rate
      request size [1 - 1023], limit 10 KB/sec, actual rate: 10.355712 KB/sec, elapsed 2.00 seconds
      request size [1 - 1023], limit 20 KB/sec, actual rate: 19.136564 KB/sec, elapsed 2.00 seconds
      request size [1 - 2047], limit 20 KB/sec, actual rate: 20.783976 KB/sec, elapsed 2.10 seconds
      request size [1 - 2047], limit 40 KB/sec, actual rate: 39.308144 KB/sec, elapsed 2.10 seconds
      request size [1 - 4095], limit 40 KB/sec, actual rate: 40.318349 KB/sec, elapsed 2.20 seconds
      request size [1 - 4095], limit 80 KB/sec, actual rate: 79.667396 KB/sec, elapsed 2.20 seconds
      request size [1 - 8191], limit 80 KB/sec, actual rate: 81.807158 KB/sec, elapsed 2.30 seconds
      request size [1 - 8191], limit 160 KB/sec, actual rate: 160.659761 KB/sec, elapsed 2.20 seconds
      request size [1 - 16383], limit 160 KB/sec, actual rate: 160.700990 KB/sec, elapsed 3.00 seconds
      request size [1 - 16383], limit 320 KB/sec, actual rate: 317.639481 KB/sec, elapsed 2.50 seconds
      [       OK ] RateLimiterTest.Rate (22618 ms)
      [ RUN      ] RateLimiterTest.LimitChangeTest
      [COMPLETE] request size 10 KB, new limit 20KB/sec, refill period 1000 ms
      [COMPLETE] request size 10 KB, new limit 5KB/sec, refill period 1000 ms
      [COMPLETE] request size 20 KB, new limit 40KB/sec, refill period 1000 ms
      [COMPLETE] request size 20 KB, new limit 10KB/sec, refill period 1000 ms
      [COMPLETE] request size 40 KB, new limit 80KB/sec, refill period 1000 ms
      [COMPLETE] request size 40 KB, new limit 20KB/sec, refill period 1000 ms
      [COMPLETE] request size 80 KB, new limit 160KB/sec, refill period 1000 ms
      [COMPLETE] request size 80 KB, new limit 40KB/sec, refill period 1000 ms
      [COMPLETE] request size 160 KB, new limit 320KB/sec, refill period 1000 ms
      [COMPLETE] request size 160 KB, new limit 80KB/sec, refill period 1000 ms
      [       OK ] RateLimiterTest.LimitChangeTest (5002 ms)
      [----------] 4 tests from RateLimiterTest (27620 ms total)
      
      [----------] Global test environment tear-down
      [==========] 4 tests from 1 test case ran. (27621 ms total)
      [  PASSED  ] 4 tests.
      ```
      
      Reviewers: sdong, IslamAbdelRahman, yiwu, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60207
      cb2476a0
    • A
      Run env_basic_test on Env::Default · 6b716765
      Andrew Kryczka 提交于
      Summary:
      Previously we couldn't run env_basic_test on Env::Default (PosixEnv on
      our platforms) since GetChildren*() behavior was inconsistent with our other
      Envs. We can normalize the output of GetChildren*() such that these test cases
      work on PosixEnv too.
      
      Test Plan: ran env_basic_test
      
      Reviewers: wanning
      
      Reviewed By: wanning
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59943
      6b716765
    • A
      Move env_basic_test cleanup to TearDown · 9eb0b539
      Andrew Kryczka 提交于
      Summary:
      move cleanup to TearDown and handle directories, so cleanup will happen
      even if a test fails in the middle.
      
      Test Plan: ./env_basic_test
      
      Reviewers: wanning
      
      Reviewed By: wanning
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60243
      9eb0b539
    • I
      Re-enable linux on travis · 1fe3bf82
      Islam AbdelRahman 提交于
      Summary: Travis clang issue on linux is fixed now, re-enable linux on travis
      
      Test Plan: https://travis-ci.org/facebook/rocksdb/builds/141098948
      
      Reviewers: yiwu, sdong, yhchiang, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D60189
      1fe3bf82
  5. 30 6月, 2016 4 次提交
  6. 29 6月, 2016 2 次提交
    • W
      b726bf59
    • Y
      Improve regression_test.sh · faa7eb3b
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff makes the following improvement in regression_test.sh:
      
      1. Add NUM_OPS and DELETE_TEST_PATH to regression_test.sh:
      
        * NUM_OPS:  The number of operations that will be issued
          in EACH thread.
          Default: $NUM_KEYS / $NUM_THREADS
      
        * DELETE_TEST_PATH: If true, then the test directory
          will be deleted after the script ends.
          Default: 0
      2. Add more information in SUMMARY.csv
      3. Fix a bug in regression_test.sh where each thread in fillseq will all issue $NUM_KEYS writes.
      4. Add --deletes in db_bench, which allows us to control the number of deletes instead of must using FLAGS_num.
      
      Test Plan: run regression test with and without DELETE_TEST_PATH and NUM_OPS
      
      Reviewers: yiwu, sdong, IslamAbdelRahman, gunnarku
      
      Reviewed By: gunnarku
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D60039
      faa7eb3b
  7. 28 6月, 2016 2 次提交
  8. 25 6月, 2016 5 次提交
    • C
      fix simple typos (#1183) · 4f2b0946
      charsyam 提交于
      4f2b0946
    • A
      ColumnFamilyOptions API [CF + RepairDB part 3/3] · 3b7ed677
      Andrew Kryczka 提交于
      Summary:
      Overload RepairDB to take vector-of-ColumnFamilyDescriptor, which tells
      us CF name + options. Also takes a ColumnFamilyOptions for unspecified column
      families encountered during the repair.
      
      One potentially confusing thing is that we store options in the constructor and
      don't invoke AddColumnFamily() until discovering the CF in ScanTable. This is
      because we don't know the CF ID until we find a table belonging to that CF.
      
      Depends on D59781.
      
      Test Plan:
        $ ./repair_test
      
      Reviewers: yhchiang, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59853
      3b7ed677
    • A
      Detect column family from properties [CF + RepairDB part 2/3] · 56ac6862
      Andrew Kryczka 提交于
      Summary:
      This diff uses the CF ID and CF name properties in the SST file
      to associate recovered data with the proper column family. Depends on D59775.
      
      - In ScanTable(), create column families in VersionSet each time a new one is discovered (via reading SST file properties)
      - In ConvertLogToTable(), dump an SST file for every column family with data in the WAL
      - In AddTables(), make a VersionEdit per-column family that adds all of that CF's tables
      
      Test Plan:
        $ ./repair_test
      
      Reviewers: yhchiang, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59781
      56ac6862
    • W
      delete 2nd level children for default env · 3fc713ed
      Wanning Jiang 提交于
      Summary: ensure no 2nd level children under test_dir_
      
      Test Plan: env_basic_test on 4 envs
      
      Reviewers: andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59979
      3fc713ed
    • A
      Refactor to use VersionSet [CF + RepairDB part 1/3] · 343507af
      Andrew Kryczka 提交于
      Summary:
      To support column families, it is easiest to use VersionSet to manage
      our column families (if we don't have Versions then ColumnFamilyData always
      behaves as a dummy column family). This diff only refactors the existing repair
      logic to use VersionSet; the next two parts will add support for multiple
      column families.
      
      Test Plan:
        $ ./repair_test
      
      Reviewers: yhchiang, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59775
      343507af
  9. 24 6月, 2016 3 次提交
  10. 23 6月, 2016 3 次提交
  11. 22 6月, 2016 5 次提交
    • O
      Add a read option to enable background purge when cleaning up iterators · c4e19b77
      omegaga 提交于
      Summary:
      Add a read option `background_purge_on_iterator_cleanup` to avoid deleting files in foreground when destroying iterators.
      Instead, a job is scheduled in high priority queue and would be executed in a separate background thread.
      
      Test Plan: Add a variant of PurgeObsoleteFileTest. Turn on background purge option in the new test, and use sleeping task to ensure files are deleted in background.
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59499
      c4e19b77
    • I
      Update DB::AddFile() to ingest the file to the lowest possible level · fa813f74
      Islam AbdelRahman 提交于
      Summary:
      DB::AddFile() right now always add the ingested file to L0
      update the logic to add the file to the lowest possible level
      
      Test Plan: unit tests
      
      Reviewers: jkedgar, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, yoshinorim
      
      Differential Revision: https://reviews.facebook.net/D59637
      fa813f74
    • I
      Remove filter_deletes from crash_test · d6b79e2f
      Islam AbdelRahman 提交于
      Summary: filter_deletes option was removed, remove it from crash_test to fix it
      
      Test Plan: make crash_test
      
      Reviewers: yhchiang, andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59901
      d6b79e2f
    • G
      Framework for enabling continuous RocksDB build and tests · a52e4d7d
      Gunnar Kudrjavets 提交于
      Summary:
      The main PHP code churn is caused by extracting the common code from `FacebookArcanistConfiguration.php` and `FacebookOldArcanistConfiguration.php` into `RocksDBCommonDeterminator.php`. This is necessary both for reducing the duplication of code and making sure that we can execute the common core logic separately from continuous runs.
      
      The main logic in `RocksDBCommonDeterminator.php` remains quite the same with the exception of some things:
      
      - Adding separation between the cases when a diff is submitted //vs.// when the code is triggered from a continuous run. There are certain actions which we should do in a case of diff only.
      
      - Adding reporting - now the person who authored the diff will receive e-mail notifications if any of the jobs have failed.
      
      - Enabling assertions and making sure that we'll terminate on failure. This is an internal code used by competent engineers, so instead of `if (!condition) { echo "Something"; exit(1); }` for every invariant I think that `assert(condition)` provides better readability with the same behavior. Especially taking into account that we're talking about things which shouldn't ever happen.
      
      Enabling this entire process will be triggered internally and will be a subject of a separate code review. We should discuss the details of triggering continuous RocksDB build and tests on that diff.
      
      Test Plan:
      - Make sure that `[p]arc diff` scenario isn't broken by verifying that tests validating this diff will pass.
      - Private testing of triggering the continuous build script.
      - Once the changes will land then author an internal job which will use the script and verify its validity.
      
      Reviewers: sdong, yhchiang, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59811
      a52e4d7d
    • I
      Makefile warning for invalid paths in make_config.mk · f9bd6677
      Islam AbdelRahman 提交于
      Summary:
      Update Makefile to show warnings when we have invalid paths in our make_config.mk file
      
      sample output
      
      ```
      $ make static_lib -j64
      Makefile:150: Warning: /mnt/gvfs/third-party2/libgcc/53e0eac8911888a105aa98b9a35fe61cf1d8b278/4.9.x/gcc-4.9-glibc-2.20/024dbc3/libs dont exist
      Makefile:150: Warning: /mnt/gvfs/third-party2/llvm-fb/b91de48a4974ec839946d824402b098d43454cef/stable/centos6-native/7aaccbe/../../src/clang/tools/scan-build/scan-build dont exist
        GEN      util/build_version.cc
      ```
      
      Test Plan: check that warning is printed visually
      
      Reviewers: sdong, yiwu, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59523
      f9bd6677
  12. 21 6月, 2016 2 次提交
  13. 18 6月, 2016 2 次提交
    • S
      Deprectate filter_deletes · 7b79238b
      sdong 提交于
      Summary: filter_deltes is not a frequently used feature. Remove it.
      
      Test Plan: Run all test suites.
      
      Reviewers: igor, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59427
      7b79238b
    • S
      Bulk load mode shouldn't stop ingest · 4939fc38
      sdong 提交于
      Summary: We introduced default slow down and stop condition, but didn't reset it in bulk load mode. Fix it.
      
      Test Plan: N/A
      
      Reviewers: igor, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59757
      4939fc38
  14. 17 6月, 2016 1 次提交