1. 03 6月, 2016 3 次提交
    • A
      Fix race condition in SwitchMemtable · 84295865
      Andrew Kryczka 提交于
      Summary:
      MemTableList::current_ could be written by background flush thread and
      simultaneously read in the user thread (NumNotFlushed() is used in
      SwitchMemtable()). Use the lock to prevent this case. Found the error from tsan.
      
      Related: D58833
      
      Test Plan:
        $ OPT=-g COMPILE_WITH_TSAN=1 make -j64 db_test
        $ TEST_TMPDIR=/dev/shm/rocksdb ./db_test --gtest_filter=DBTest.RepeatedWritesToSameKey
      
      Reviewers: lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59139
      84295865
    • Y
      Allows db_bench to take an options file · 88acd932
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch allows db_bench to initialize it's RocksDB Options via a
      options file, specified by the --options_file flag.  Note that if
      --options_file flag is set, then it has higher priority than the
      command-line argument.
      
      Test Plan: db_bench_tool_test
      
      Reviewers: sdong, IslamAbdelRahman, kradhakrishnan, yiwu, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58533
      88acd932
    • P
      Add a callback for when memtable is moved to immutable (#1137) · 3a276b0c
      PraveenSinghRao 提交于
      * Create a callback for memtable becoming immutable
      
      Create a callback for memtable becoming immutable
      
      Create a callback for memtable becoming immutable
      
      moved notification outside the lock
      
      Move sealed notification to unlocked portion of SwitchMemtable
      
      * fix lite build
      3a276b0c
  2. 02 6月, 2016 5 次提交
    • Y
      Allow regression test to run db_bench at a remost host · 8cf0f86d
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch does the following improvement on the regression_test.sh
      * allows db_bench being executed at a remost host while storing the
        benchmark results locally.
      * kills all db_bench related processes before running db_bench
      * better error handling.
      
      Test Plan:
      1. Run regression_test.sh both locally and remotely
      2. Run multiple regression_test.sh at the same time and make sure
         i. Only one runs successfully.
         ii. The one that runs successfully will kill all other db_bench
             processes before it runs any benchmark.
      
      Reviewers: sdong, yiwu, gunnarku
      
      Reviewed By: gunnarku
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58611
      8cf0f86d
    • K
      Fix Windows build break · 27ad1707
      krad 提交于
      Summary:
      Direct IO checkin breaks Windows build. Fixing the code to work for
      Windows.
      
      Test Plan: Run env_test in Windows 10 and make check in Linux
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59073
      27ad1707
    • M
      Small tweaks to logging to track the number of immutable memtables · 936973d1
      Mike Kolupaev 提交于
      Summary:
      We see some write stalls because of number of unflushed memtables. With existing logging I couldn't figure out what's happening exactly. See internal task t11446054 for details if interested. This diff adds:
      - logging of memtable creation at info level; I wanted it on multiple occasions for different reasons; also include number of immutable memtables,
      - logging of number of remaining immutable memtables after a flush.
      
      Test Plan: ran tests
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58833
      936973d1
    • S
      add readahead size option (#1146) · 21c047ab
      siddontang 提交于
      21c047ab
    • V
      Assert boundary checks for SetPerfLevel() · 71c7eed9
      Vasile Paraschiv 提交于
      Summary: Add asserts around PerfLevel enum
      
      Test Plan: make all check -j32
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59007
      71c7eed9
  3. 01 6月, 2016 2 次提交
    • R
      add missing lock · 5d85fdb2
      Reid Horuff 提交于
      5d85fdb2
    • S
      LDBCommand::SelectCommand to use a struct as the parameter · c40c4cae
      sdong 提交于
      Summary: The function wrapper for LDBCommand::SelectCommand is too long so that Windows build fails with warning "decorated name length exceeded, name was truncated". Shrink the length by using a struct.
      
      Test Plan: Build on both of Linux and Windows and make sure the warning doesn't show in either platform.
      
      Reviewers: andrewkr, adsharma, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58965
      c40c4cae
  4. 30 5月, 2016 1 次提交
  5. 28 5月, 2016 6 次提交
    • A
      Add statically-linked library for tools/benchmarks · 8dfa980c
      Andrew Kryczka 提交于
      Summary:
      Currently all the tools are included in librocksdb.a (db_bench is not). With
      this separate library, we can access db_bench functionality from our internal
      repo and eventually move tools out of librocksdb.a.
      
      Test Plan: built a simple binary against this library that invokes db_bench_tool().
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58977
      8dfa980c
    • S
      Handle overflow case of rate limiter's paramters · f62fbd2c
      sdong 提交于
      Summary: When rate_bytes_per_sec * refill_period_us_ overflows, the actual limited rate is very low. Handle this case so the rate will be large.
      
      Test Plan: Add a unit test for it.
      
      Reviewers: IslamAbdelRahman, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: yiwu, lightmark, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58929
      f62fbd2c
    • A
      In-memory environment read beyond EOF · 57461fba
      Andrew Kryczka 提交于
      Summary:
      Made it consistent with posix Env, which uses pread() that returns 0
      (success) when an offset is given beyond EOF. The purpose of making these Envs
      behave consistently is I am repurposing the in-memory Envs' tests for the basic
      Env tests in D58635.
      
      Test Plan: ran mock_env_test and memenv_test
      
      Reviewers: IslamAbdelRahman, lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58845
      57461fba
    • S
      LDBCommand::InitFromCmdLineArgs() to move from template to function wrapper · 0e200001
      sdong 提交于
      Summary:
      Build failure with some compiler setting with
      
      tools/reduce_levels_test.cc:97: undefined reference to `rocksdb::LDBCommand* rocksdb::LDBCommand::InitFromCmdLineArgs<rocksdb::LDBCommand* (*)(std::string const&, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator<std::string> > const&)>(std::vector<std::string, std::allocator<std::string> > const&, rocksdb::Options const&, rocksdb::LDBOptions const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const*, rocksdb::LDBCommand* (*)(std::string const&, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator<std::string> > const&))'
      
      Fix it by changing to function pointer instead
      
      Test Plan: Run all existing tests
      
      Reviewers: andrewkr, kradhakrishnan, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: adsharma, lightmark, yiwu, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58905
      0e200001
    • V
      Add low and upper bound values for rocksdb::PerfLevel enum · 472c06e9
      Vasile Paraschiv 提交于
      Summary:
      Add under and over limits for rocksdb::PerfLevel enum
      to allow us to do boundary checks before casting ints or unints
      to this enum.
      
      Test Plan: make all check -j32
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58521
      472c06e9
    • S
      MutexLock -> ThreadPoolMutexLock in util/threadpool.cc · 157e0633
      sdong 提交于
      Summary: util/threadpool.cc's function name is the same as a well-known class name. It breaks unity build. Rename it.
      
      Test Plan: Run all existing test.
      
      Reviewers: yiwu, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58881
      157e0633
  6. 27 5月, 2016 2 次提交
    • S
      include/rocksdb/sst_file_writer.h should not depend on util/mutable_cf_options.h · 23d4cf48
      sdong 提交于
      Summary: I don't think util/mutable_cf_options.h is needed inside include/rocksdb/sst_file_writer.h and it is not allowed. Remove it.
      
      Test Plan: Run all tests
      
      Reviewers: IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: lightmark, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58827
      23d4cf48
    • S
      Fix flaky DBTestDynamicLevel.DynamicLevelMaxBytesBase2 · 345fd73f
      sdong 提交于
      Summary: We added more table properties for each SST file, so when using 2KB SST file size, the estimated size of SST files is off by almost half, causing the LSM tree structure not as expected. Fix it by making file size 4x as previously, as well as LSM base size. Also avoid the sleeping based synchronization and turn to use sync points.
      
      Test Plan: Run paralell unit tests multiple times and make sure they always pass.
      
      Reviewers: IslamAbdelRahman, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58749
      345fd73f
  7. 25 5月, 2016 2 次提交
  8. 24 5月, 2016 6 次提交
    • A
      add simulator Cache as class SimCache/SimLRUCache(with test) · 5d660258
      Aaron Gao 提交于
      Summary: add class SimCache(base class with instrumentation api) and SimLRUCache(derived class with detailed implementation) which is used as an instrumented block cache that can predict hit rate for different cache size
      
      Test Plan:
      Add a test case in `db_block_cache_test.cc` called `SimCacheTest` to test basic logic of SimCache.
      Also add option `-simcache_size` in db_bench. if set with a value other than -1, then the benchmark will use this value as the size of the simulator cache and finally output the simulation result.
      ```
      [gzh@dev9927.prn1 ~/local/rocksdb] ./db_bench -benchmarks "fillseq,readrandom" -cache_size 1000000 -simcache_size 1000000
      RocksDB:    version 4.8
      Date:       Tue May 17 16:56:16 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: 0
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :       6.809 micros/op 146874 ops/sec;   16.2 MB/s
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      readrandom   :       6.343 micros/op 157665 ops/sec;   17.4 MB/s (1000000 of 1000000 found)
      
      SIMULATOR CACHE STATISTICS:
      SimCache LOOKUPs: 986559
      SimCache HITs:    264760
      SimCache HITRATE: 26.84%
      
      [gzh@dev9927.prn1 ~/local/rocksdb] ./db_bench -benchmarks "fillseq,readrandom" -cache_size 1000000 -simcache_size 10000000
      RocksDB:    version 4.8
      Date:       Tue May 17 16:57:10 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: 0
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :       5.066 micros/op 197394 ops/sec;   21.8 MB/s
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      readrandom   :       6.457 micros/op 154870 ops/sec;   17.1 MB/s (1000000 of 1000000 found)
      
      SIMULATOR CACHE STATISTICS:
      SimCache LOOKUPs: 1059764
      SimCache HITs:    374501
      SimCache HITRATE: 35.34%
      
      [gzh@dev9927.prn1 ~/local/rocksdb] ./db_bench -benchmarks "fillseq,readrandom" -cache_size 1000000 -simcache_size 100000000
      RocksDB:    version 4.8
      Date:       Tue May 17 16:57:32 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: 0
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :       5.632 micros/op 177572 ops/sec;   19.6 MB/s
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      readrandom   :       6.892 micros/op 145094 ops/sec;   16.1 MB/s (1000000 of 1000000 found)
      
      SIMULATOR CACHE STATISTICS:
      SimCache LOOKUPs: 1150767
      SimCache HITs:    1034535
      SimCache HITRATE: 89.90%
      ```
      
      Reviewers: IslamAbdelRahman, andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: MarkCallaghan, andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57999
      5d660258
    • O
      Update CMakeLists.txt for added test · d379d110
      omegaga 提交于
      Summary: Update CMakeLists.txt for added db_io_failure_test. Depends on D58341
      
      Test Plan: Run make check to see if the tests are working properly.
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58671
      d379d110
    • K
      Direct IO fix for Mac · 21f847ed
      krad 提交于
      Summary:
      O_DIRECT is not available in Mac as a flag for open. The fix is to make
      use of fctl after the file is opened
      
      Test Plan: Run the tests on mac and Linux
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58665
      21f847ed
    • A
      Clean up the ComputeCompactionScore() API · 99765ed8
      Ashish Shenoy 提交于
      Summary: Make CompactionOptionsFIFO a part of mutable_cf_options
      
      Test Plan: UT
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, lgalanis, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58653
      99765ed8
    • S
      Expose report_bg_io_stats option in the C API. (#1131) · def2f7bd
      Shen Li 提交于
      def2f7bd
    • K
      Direct IO capability for RocksDB · f89caa12
      krad 提交于
      Summary:
      This patch adds direct IO capability to RocksDB Env.
      
      The direct IO capability is required for persistent cache since NVM is best
      accessed as 4K direct IO. SSDs can leverage direct IO for reading.
      
      Direct IO requires the offset and size be sector size aligned, and memory to
      be kernel page aligned. Since neither RocksDB/Persistent read cache data
      layout is aligned to sector size, the code can accommodate reading unaligned IO size
      (or unaligned memory) at the cost of an alloc/copy.
      
      The write code path expects the size and memory to be aligned.
      
      Test Plan: Run RocksDB unit tests
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57393
      f89caa12
  9. 23 5月, 2016 7 次提交
  10. 21 5月, 2016 2 次提交
  11. 20 5月, 2016 4 次提交