1. 11 6月, 2016 1 次提交
    • S
      Merge db/slice.cc into util/slice.cc · 6faddd7c
      sdong 提交于
      Summary: It confuses some compilers to have slice.cc under multiple directories. Merge them.
      
      Test Plan: Run existing tests
      
      Reviewers: andrewkr, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59409
      6faddd7c
  2. 10 6月, 2016 1 次提交
    • S
      Remove options builder · b2973eaa
      sdong 提交于
      Summary: AFIK, options builder is not used by anyone. Remove it.
      
      Test Plan: Run all existing tests.
      
      Reviewers: IslamAbdelRahman, andrewkr, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D59319
      b2973eaa
  3. 08 6月, 2016 1 次提交
    • K
      Persistent Read Cache (5) Volatile cache tier implementation · d755c62f
      krad 提交于
      Summary:
      This provides provides an implementation of PersistentCacheTier that is
      specialized for RAM. This tier does not persist data though.
      
      Why do we need this tier ?
      
      This is ideal as tier 0. This tier can host data that is too hot.
      
      Why can't we use Cache variants ?
      
      Yes you can use them instead. This tier can potentially outperform BlockCache
      in RAW mode by virtue of compression and compressed cache in block cache doesn't
      seem very popular. Potentially this tier can be modified to under stand the
      disadvantage of the tier below and retain data that the tier below is bad at
      handling (for example index and bloom data that is huge in size)
      
      Test Plan: Run unit tests added
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57069
      d755c62f
  4. 07 6月, 2016 1 次提交
    • K
      Persistent Read Cache (4) Interface definitions · 3070ed90
      krad 提交于
      Summary:
      This diff provides the basic interface definitions of persistent read
      cache system
      
      PersistentCacheOptions captures the persistent read cache options used to
      configure and control the system
      PersistentCacheTier provides the basic building block for constructing tiered
      cache
      PersistentTieredCache provides a logical abstraction of tiers of cache layered
      over one another
      
      Test Plan: Compile
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57051
      3070ed90
  5. 04 6月, 2016 1 次提交
    • A
      Create env_basic_test [pluggable Env part 2] · 6e6622ab
      Andrew Kryczka 提交于
      Summary:
      Extracted basic Env-related tests from mock_env_test and memenv_test into a
      parameterized test for Envs: env_basic_test.
      
      Depends on D58449. (The dependency is here only so I can keep this series of
      diffs in a chain -- there is no dependency on that diff's code.)
      
      Test Plan: ran tests
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58635
      6e6622ab
  6. 03 6月, 2016 2 次提交
    • A
      Env registry for URI-based Env selection [pluggable Env part 1] · af0c9ac0
      Andrew Kryczka 提交于
      Summary:
      This enables configurable Envs without recompiling. For example, my
      next diff will make env_test test an Env created by NewEnvFromUri(). Then,
      users can determine which Env is tested simply by providing the URI for
      NewEnvFromUri() (e.g., through a CLI argument or environment variable).
      
      The registration process allows us to register any Env that is linked with the
      RocksDB library, so we can register our internal Envs as well.
      
      The registration code is inspired by our internal InitRegistry.
      
      Test Plan: new unit test
      
      Reviewers: IslamAbdelRahman, lightmark, ldemailly, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba, andrewkr
      
      Differential Revision: https://reviews.facebook.net/D58449
      af0c9ac0
    • 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
  7. 24 5月, 2016 1 次提交
    • 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
  8. 21 5月, 2016 1 次提交
  9. 20 5月, 2016 1 次提交
  10. 19 5月, 2016 1 次提交
    • O
      Move IO failure test to separate file · 3c69f77c
      omegaga 提交于
      Summary:
      This is a part of effort to reduce the size of db_test.cc. We move the following tests to a separate file `db_io_failure_test.cc`:
      
      * DropWrites
      * DropWritesFlush
      * NoSpaceCompactRange
      * NonWritableFileSystem
      * ManifestWriteError
      * PutFailsParanoid
      
      Test Plan: Run `make check` to see if the tests are working properly.
      
      Reviewers: sdong, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58341
      3c69f77c
  11. 16 5月, 2016 1 次提交
    • K
      Added PersistentCache abstraction · a08c8c85
      krad 提交于
      Summary:
      Added a new abstraction to cache page to RocksDB designed for the read
      cache use.
      
      RocksDB current block cache is more of an object cache. For the persistent read cache
      project, what we need is a page cache equivalent. This changes adds a cache
      abstraction to RocksDB to cache pages called PersistentCache. PersistentCache can cache
      uncompressed pages or raw pages (content as in filesystem). The user can
      choose to operate PersistentCache either in  COMPRESSED or UNCOMPRESSED mode.
      
      Blame Rev:
      
      Test Plan: Run unit tests
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D55707
      a08c8c85
  12. 13 5月, 2016 1 次提交
  13. 11 5月, 2016 1 次提交
    • R
      [rocksdb] Recovery path sequence miscount fix · a657ee9a
      Reid Horuff 提交于
      Summary:
      Consider the following WAL with 4 batch entries prefixed with their sequence at time of memtable insert.
      [1: BEGIN_PREPARE, PUT, PUT, PUT, PUT, END_PREPARE(a)]
      [1: BEGIN_PREPARE, PUT, PUT, PUT, PUT, END_PREPARE(b)]
      [4: COMMIT(a)]
      [7: COMMIT(b)]
      
      The first two batches do not consume any sequence numbers so are both prefixed with seq=1.
      For 2pc commit, memtable insertion takes place before COMMIT batch is written to WAL.
      We can see that sequence number consumption takes place between WAL entries giving us the seemingly sparse sequence prefix for WAL entries.
      This is a valid WAL.
      
      Because with 2PC markers one WriteBatch points to another batch containing its inserts a writebatch can consume more or less sequence numbers than the number of sequence consuming entries that it contains.
      
      We can see that, given the entries in the WAL, 6 sequence ids were consumed. Yet on recovery the maximum sequence consumed would be 7 + 3 (the number of sequence numbers consumed by COMMIT(b))
      
      So, now upon recovery we must track the actual consumption of sequence numbers.
      In the provided scenario there will be no sequence gaps, but it is possible to produce a sequence gap. This should not be a problem though. correct?
      
      Test Plan: provided test.
      
      Reviewers: sdong
      
      Subscribers: andrewkr, leveldb, dhruba, hermanlee4
      
      Differential Revision: https://reviews.facebook.net/D57645
      a657ee9a
  14. 07 5月, 2016 1 次提交
    • A
      Introduce chroot Env · 3f16a836
      Andrew Kryczka 提交于
      Summary:
      For testing backups, we needed an Env that is fully isolated from other
      Envs on the same machine. Our in-memory Envs (MockEnv and InMemoryEnv) were
      insufficient because they don't implement most directory operations.
      
      This diff introduces a new Env, "ChrootEnv", that translates paths such that the
      chroot directory appears to be the root directory. This way, multiple Envs can
      be isolated in the filesystem by using different chroot directories. Since we
      use the filesystem, all directory operations are trivially supported.
      
      Test Plan:
      I parameterized the existing EnvPosixTest so it runs tests on ChrootEnv
      except the ioctl-related cases.
      
      Reviewers: sdong, lightmark, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57543
      3f16a836
  15. 19 4月, 2016 1 次提交
    • Y
      Split db_test.cc · 792762c4
      Yi Wu 提交于
      Summary: Split db_test.cc into several files. Moving several helper functions into DBTestBase.
      
      Test Plan: make check
      
      Reviewers: sdong, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: dhruba, andrewkr, kradhakrishnan, yhchiang, leveldb, sdong
      
      Differential Revision: https://reviews.facebook.net/D56715
      792762c4
  16. 12 3月, 2016 2 次提交
  17. 24 2月, 2016 1 次提交
    • Y
      IOStatsContext::ToString() add option to exclude zero counters · 2568985a
      Yi Wu 提交于
      Summary: similar to D52809 add option to exclude zero counters.
      
      Test Plan:
      [yiwu@dev4504.prn1 ~/rocksdb] ./iostats_context_test
      [==========] Running 1 test from 1 test case.
      [----------] Global test environment set-up.
      [----------] 1 test from IOStatsContextTest
      [ RUN      ] IOStatsContextTest.ToString
      [       OK ] IOStatsContextTest.ToString (0 ms)
      [----------] 1 test from IOStatsContextTest (0 ms total)
      
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test case ran. (0 ms total)
      [  PASSED  ] 1 test.
      
      Reviewers: anthony, yhchiang, andrewkr, IslamAbdelRahman, kradhakrishnan, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D54591
      2568985a
  18. 16 2月, 2016 1 次提交
    • J
      Separeate main from bench functionality to allow cusomizations · 7bd284c3
      Jonathan Wiepert 提交于
      Summary: Isolate db_bench functionality from main so custom benchmark code can be written and managed
      
      Test Plan:
      Tested commands
      ./build_tools/regression_build_test.sh
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000 --reads=500 --writes=500
      ./db_bench --db=/tmp/rocksdbtest-12321/dbbench --stats_interval_seconds=1 --num=1000 --merge_keys=100 --numdistinct=100 --num_column_families=3 --num_hot_column_families=1
      ./db_bench --stats_interval_seconds=1 --num=1000 --bloom_locality=1 --seed=5 --threads=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --usee_uint64_comparator=true --batch-size=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --use_uint64_comparator=true --batch_size=5
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --usee_uint64_comparator=true --batch-size=5
      
      Test Results - https://phabricator.fb.com/P56130387
      
      Additional tests for:
      ./db_bench --duration=60 --value_size=50 --seek_nexts=10 --reverse_iterator=true --use_uint64_comparator=true --batch_size=5 --key_size=8 --merge_operator=put
      ./db_bench --stats_interval_seconds=1 --num=1000 --bloom_locality=1 --seed=5 --threads=5 --merge_operator=uint64add
      
      Results: https://phabricator.fb.com/P56130607
      
      Reviewers: yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D53991
      7bd284c3
  19. 04 2月, 2016 1 次提交
  20. 29 1月, 2016 1 次提交
  21. 27 1月, 2016 2 次提交
  22. 26 12月, 2015 1 次提交
    • N
      support for concurrent adds to memtable · 7d87f027
      Nathan Bronson 提交于
      Summary:
      This diff adds support for concurrent adds to the skiplist memtable
      implementations.  Memory allocation is made thread-safe by the addition of
      a spinlock, with small per-core buffers to avoid contention.  Concurrent
      memtable writes are made via an additional method and don't impose a
      performance overhead on the non-concurrent case, so parallelism can be
      selected on a per-batch basis.
      
      Write thread synchronization is an increasing bottleneck for higher levels
      of concurrency, so this diff adds --enable_write_thread_adaptive_yield
      (default off).  This feature causes threads joining a write batch
      group to spin for a short time (default 100 usec) using sched_yield,
      rather than going to sleep on a mutex.  If the timing of the yield calls
      indicates that another thread has actually run during the yield then
      spinning is avoided.  This option improves performance for concurrent
      situations even without parallel adds, although it has the potential to
      increase CPU usage (and the heuristic adaptation is not yet mature).
      
      Parallel writes are not currently compatible with
      inplace updates, update callbacks, or delete filtering.
      Enable it with --allow_concurrent_memtable_write (and
      --enable_write_thread_adaptive_yield).  Parallel memtable writes
      are performance neutral when there is no actual parallelism, and in
      my experiments (SSD server-class Linux and varying contention and key
      sizes for fillrandom) they are always a performance win when there is
      more than one thread.
      
      Statistics are updated earlier in the write path, dropping the number
      of DB mutex acquisitions from 2 to 1 for almost all cases.
      
      This diff was motivated and inspired by Yahoo's cLSM work.  It is more
      conservative than cLSM: RocksDB's write batch group leader role is
      preserved (along with all of the existing flush and write throttling
      logic) and concurrent writers are blocked until all memtable insertions
      have completed and the sequence number has been advanced, to preserve
      linearizability.
      
      My test config is "db_bench -benchmarks=fillrandom -threads=$T
      -batch_size=1 -memtablerep=skip_list -value_size=100 --num=1000000/$T
      -level0_slowdown_writes_trigger=9999 -level0_stop_writes_trigger=9999
      -disable_auto_compactions --max_write_buffer_number=8
      -max_background_flushes=8 --disable_wal --write_buffer_size=160000000
      --block_size=16384 --allow_concurrent_memtable_write" on a two-socket
      Xeon E5-2660 @ 2.2Ghz with lots of memory and an SSD hard drive.  With 1
      thread I get ~440Kops/sec.  Peak performance for 1 socket (numactl
      -N1) is slightly more than 1Mops/sec, at 16 threads.  Peak performance
      across both sockets happens at 30 threads, and is ~900Kops/sec, although
      with fewer threads there is less performance loss when the system has
      background work.
      
      Test Plan:
      1. concurrent stress tests for InlineSkipList and DynamicBloom
      2. make clean; make check
      3. make clean; DISABLE_JEMALLOC=1 make valgrind_check; valgrind db_bench
      4. make clean; COMPILE_WITH_TSAN=1 make all check; db_bench
      5. make clean; COMPILE_WITH_ASAN=1 make all check; db_bench
      6. make clean; OPT=-DROCKSDB_LITE make check
      7. verify no perf regressions when disabled
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: MarkCallaghan, IslamAbdelRahman, anthony, yhchiang, rven, sdong, guyg8, kradhakrishnan, dhruba
      
      Differential Revision: https://reviews.facebook.net/D50589
      7d87f027
  23. 11 12月, 2015 1 次提交
    • S
      env: add EnvMirror · 2074ddd6
      Sage Weil 提交于
      This is an Env implementation that mirrors all storage-related methods on
      two different backend Env's and verifies that they return the same
      results (return status and read results).  This is useful for implementing
      a new Env and verifying its correctness.
      Signed-off-by: NSage Weil <sage@redhat.com>
      2074ddd6
  24. 07 12月, 2015 1 次提交
    • J
      Move posix threads into a library · b2863017
      Javier González 提交于
      Summary: This patch moves all posix thread logic to a separate library.
      The motivation is to allow another environments to easily reuse posix
      threads. HDFS wraps already posix threads; this split would simplify
      this code.
      
      Test Plan: No new functionality is added to posix Env or the threading
      library, thus the current tests should suffice.
      b2863017
  25. 25 11月, 2015 1 次提交
    • N
      InlineSkipList - part 1/3 · 78812ec6
      Nathan Bronson 提交于
      Summary:
      This diff is 1/3 in a sequence that introduces a skip list optimized for
      a key that is a freshly-allocated const char*.  The diff is broken into
      pieces to make it easier to review.  This piece only introduces the new
      type by copying the existing SkipList, with mechanical naming changes
      and reformatting.
      
      Test Plan: new unit test
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D51279
      78812ec6
  26. 19 11月, 2015 1 次提交
    • S
      Not to build forward_iterator_bench now · c4ebb66d
      sdong 提交于
      Summary: forward_iterator_bench is not stable enough for build. Remove it for now.
      
      Test Plan: Build it with both of CLANG and non-CLANG and make sure it builds.
      
      Reviewers: rven, kradhakrishnan, anthony, yhchiang, igor, IslamAbdelRahman
      
      Reviewed By: igor, IslamAbdelRahman
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D50991
      c4ebb66d
  27. 14 11月, 2015 1 次提交
    • V
      Reuse file iterators in tailing iterator when memtable is flushed · 7824444b
      Venkatesh Radhakrishnan 提交于
      Summary:
      Under a tailing workload, there were increased block cache
      misses when a memtable was flushed because we were rebuilding iterators
      in that case since the version set changed. This was exacerbated in the
      case of iterate_upper_bound, since file iterators which were over the
      iterate_upper_bound would have been deleted and are now brought back as
      part of the Rebuild, only to be deleted again. We now renew the iterators
      and only build iterators for files which are added and delete file
      iterators for files which are deleted.
      Refer to https://reviews.facebook.net/D50463 for previous version
      
      Test Plan: DBTestTailingIterator.TailingIteratorTrimSeekToNext
      
      Reviewers: anthony, IslamAbdelRahman, igor, tnovak, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: yhchiang, march, dhruba, leveldb, lovro
      
      Differential Revision: https://reviews.facebook.net/D50679
      7824444b
  28. 12 11月, 2015 1 次提交
    • Y
      Add OptionsUtil::LoadOptionsFromFile() API · e11f676e
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch adds OptionsUtil::LoadOptionsFromFile() and
      OptionsUtil::LoadLatestOptionsFromDB(), which allow developers
      to construct DBOptions and ColumnFamilyOptions from a RocksDB
      options file.  Note that most pointer-typed options such as
      merge_operator will not be constructed.
      
      With this API, developers no longer need to remember all the
      options in order to reopen an existing rocksdb instance like
      the following:
      
        DBOptions db_options;
        std::vector<std::string> cf_names;
        std::vector<ColumnFamilyOptions> cf_opts;
      
        // Load primitive-typed options from an existing DB
        OptionsUtil::LoadLatestOptionsFromDB(
            dbname, &db_options, &cf_names, &cf_opts);
      
        // Initialize necessary pointer-typed options
        cf_opts[0].merge_operator.reset(new MyMergeOperator());
        ...
      
        // Construct the vector of ColumnFamilyDescriptor
        std::vector<ColumnFamilyDescriptor> cf_descs;
        for (size_t i = 0; i < cf_opts.size(); ++i) {
          cf_descs.emplace_back(cf_names[i], cf_opts[i]);
        }
      
        // Open the DB
        DB* db = nullptr;
        std::vector<ColumnFamilyHandle*> cf_handles;
        auto s = DB::Open(db_options, dbname, cf_descs,
                          &handles, &db);
      
      Test Plan:
      Augment existing tests in column_family_test
      options_test
      db_test
      
      Reviewers: igor, IslamAbdelRahman, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D49095
      e11f676e
  29. 11 11月, 2015 1 次提交
    • Y
      Enable RocksDB to persist Options file. · e114f0ab
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch allows rocksdb to persist options into a file on
      DB::Open, SetOptions, and Create / Drop ColumnFamily.
      Options files are created under the same directory as the rocksdb
      instance.
      
      In addition, this patch also adds a fail_if_missing_options_file in DBOptions
      that makes any function call return non-ok status when it is not able to
      persist options properly.
      
        // If true, then DB::Open / CreateColumnFamily / DropColumnFamily
        // / SetOptions will fail if options file is not detected or properly
        // persisted.
        //
        // DEFAULT: false
        bool fail_if_missing_options_file;
      
      Options file names are formatted as OPTIONS-<number>, and RocksDB
      will always keep the latest two options files.
      
      Test Plan:
      Add options_file_test.
      
      options_test
      column_family_test
      
      Reviewers: igor, IslamAbdelRahman, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D48285
      e114f0ab
  30. 10 11月, 2015 1 次提交
    • N
      Switch to thread-local random for skiplist · b81b4309
      Nathan Bronson 提交于
      Summary:
      Using a TLS random instance for skiplist makes it smaller
      (useful for hash_skiplist_rep) and prepares skiplist for concurrent
      adds.  This diff also modifies the branching factor math to avoid an
      unnecessary division.
      
      This diff has the effect of changing the sequence of skip list node
      height choices made by tests, so it has the potential to cause unit
      test failures for tests that implicitly rely on the exact structure
      of the skip list.  Tests that try to exactly trigger a compaction are
      likely suspects for this problem (these tests have always been brittle to
      changes in the skiplist details).  I've minimizes this risk by reseeding
      the main thread's Random at the beginning of each test, increasing the
      universal compaction size_ratio limit from 101% to 105% for some tests,
      and verifying that the tests pass many times.
      
      Test Plan: for i in `seq 0 9`; do make check; done
      
      Reviewers: sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D50439
      b81b4309
  31. 05 11月, 2015 1 次提交
    • Y
      Add OptionsSanityCheckLevel · 183cadfc
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch introduces OptionsSanityCheckLevel internally to enable
      sanity check rocksdb options.
      
      Utilities API will be added in the follow-up diffs.
      
      Test Plan: Added more tests in options_test
      
      Reviewers: igor, IslamAbdelRahman, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D49515
      183cadfc
  32. 04 11月, 2015 1 次提交
    • Y
      Add Memory Insight support to utilities · 7d7ee2b6
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch introduces utilities/memory, which currently includes
      GetApproximateMemoryUsageByType that reports different types of
      rocksdb memory usage given a list of input DBs.
      
      The API also take care of the case where Cache could be shared
      across multiple column families / multiple db instances.
      
      Currently, it reports memory usage of memtable, table-readers
      and cache.
      
      Test Plan: utilities/memory/memory_test.cc
      
      Reviewers: igor, anthony, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D49257
      7d7ee2b6
  33. 22 10月, 2015 1 次提交
    • J
      Split posix storage backend into Env and library · 6e6dd5f6
      Javier González 提交于
      Summary: This patch splits the posix storage backend into Env and
      the actual *File implementations. The motivation is to allow other Envs
      to use posix as a library. This enables a storage backend different from
      posix to split its secondary storage between a normal file system
      partition managed by posix, and it own media.
      
      Test Plan: No new functionality is added to posix Env or the library,
      thus the current tests should suffice.
      6e6dd5f6
  34. 18 10月, 2015 1 次提交
  35. 17 10月, 2015 1 次提交
  36. 15 10月, 2015 2 次提交