1. 11 11月, 2015 4 次提交
    • 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
    • D
      Make use of portable `uint64_t` type to make possible file access · 5270b33b
      Dmitri Smirnov 提交于
        in 64-bit.
      
        Currently, a signed off_t type is being used for the following
        interfaces for both offset and the length in bytes:
        * `Allocate`
        * `RangeSync`
      
        On Linux `off_t` is automatically either 32 or 64-bit depending on
        the platform. On Windows it is always a 32-bit signed long which
        limits file access and in particular space pre-allocation
        to effectively 2 Gb.
      
        Proposal is to replace off_t with uint64_t as a portable type
        always access files with 64-bit interfaces.
      
        May need to modify posix code but lack resources to test it.
      5270b33b
    • N
      remove constexpr from util/random.h for MSVC compat · 505accda
      Nathan Bronson 提交于
      Summary:
      Scoped anonymous enums seem to be better supported than static
      constexpr at the moment, so this diff replaces the latter with the former.
      Also, this diff removes an incorrect inclusion of pthread.h.  MSVC build
      was broken starting with D50439.
      
      Test Plan:
      1. build
      2. observe proper skiplist behavior by absence of pathological slowdown
      3. push diff to tmp_try_windows branch to tickle AppVeyor
      4. wait for contbuild before committing to master
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D50517
      505accda
    • D
      Make use of portable `uint64_t` type to make possible file access · 5421c972
      Dmitri Smirnov 提交于
        in 64-bit.
      
        Currently, a signed off_t type is being used for the following
        interfaces for both offset and the length in bytes:
        * `Allocate`
        * `RangeSync`
      
        On Linux `off_t` is automatically either 32 or 64-bit depending on
        the platform. On Windows it is always a 32-bit signed long which
        limits file access and in particular space pre-allocation
        to effectively 2 Gb.
      
        Proposal is to replace off_t with uint64_t as a portable type
        always access files with 64-bit interfaces.
      
        May need to modify posix code but lack resources to test it.
      5421c972
  2. 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
  3. 07 11月, 2015 1 次提交
    • D
      Enable Windows warnings C4307 C4309 C4512 C4701 · 20f57b17
      Dmitri Smirnov 提交于
        Enable C4307 'operator' : integral constant overflow
        Longs and ints on Windows are 32-bit hence the overflow
        Enable C4309 'conversion' : truncation of constant value
        Enable C4512 'class' : assignment operator could not be generated
        Enable C4701 Potentially uninitialized local variable 'name' used
      20f57b17
  4. 06 11月, 2015 1 次提交
    • V
      Prefix-based iterating only shows keys in prefix · 9d50afc3
      Venkatesh Radhakrishnan 提交于
      Summary:
      MyRocks testing found an issue that while iterating over keys
      that are outside the prefix, sometimes wrong results were seen for keys
      outside the prefix. We now tighten the range of keys seen with a new
      read option called prefix_seen_at_start. This remembers the starting
      prefix and then compares it on a Next for equality of prefix. If they
      are from a different prefix, it sets valid to false.
      
      Test Plan: PrefixTest.PrefixValid
      
      Reviewers: IslamAbdelRahman, sdong, yhchiang, anthony
      
      Reviewed By: anthony
      
      Subscribers: spetrunia, hermanlee4, yoshinorim, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D50211
      9d50afc3
  5. 05 11月, 2015 2 次提交
    • I
      Fix clang · 042fb053
      Islam AbdelRahman 提交于
      Summary: Fix build for clang
      
      Test Plan:
      USE_CLANG=1 make all -j64
      make clean
      make check -j64
      
      Reviewers: yhchiang
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D50217
      042fb053
    • 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
  6. 03 11月, 2015 1 次提交
    • D
      Do not disable compiler warnings: · a0163c06
      Dmitri Smirnov 提交于
        C4101 'identifier' : unreferenced local variable
        C4189 'identifier' : local variable is initialized but not referenced
        C4100 'identifier' : unreferenced formal parameter
        C4296 'operator' : expression is always false
      a0163c06
  7. 31 10月, 2015 2 次提交
  8. 30 10月, 2015 3 次提交
  9. 29 10月, 2015 3 次提交
  10. 28 10月, 2015 5 次提交
    • I
      Fix WritableFileWriter::Append() return · 72d6e758
      Islam AbdelRahman 提交于
      Summary: It looks like WritableFileWriter::Append() was returning OK() even when there is an error
      
      Test Plan: make check
      
      Reviewers: sdong, yhchiang, anthony, rven, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D49569
      72d6e758
    • S
      Avoid to reply on ROCKSDB_FALLOCATE_PRESENT in include/posix/io_posix.h · c37223c0
      sdong 提交于
      Summary: include/posix/io_posix.h should not depend on ROCKSDB_FALLOCATE_PRESENT. Remove it.
      
      Test Plan: Build it with both of ROCKSDB_FALLOCATE_PRESENT defined and not defined.
      
      Reviewers: rven, yhchiang, anthony, kradhakrishnan, IslamAbdelRahman, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D49563
      c37223c0
    • D
      Implement smart buffer management. · 6fbc4f9f
      Dmitri Smirnov 提交于
        introduce a new DBOption random_access_max_buffer_size to limit
        the size of the random access buffer used for unbuffered access.
        Implement read ahead buffering when enabled.
        To that effect propagate compaction_readahead_size and the new option
        to the env options to make it available for the implementation.
        Add Hint() override so SetupForCompaction() call would call Hint()
        readahead can now be setup from both Hint() and EnableReadAhead()
        Add new option random_access_max_buffer_size support
        db_bench, options_helper to make it string parsable
        and the unit test.
      6fbc4f9f
    • S
      Mac build break caused by include/posix/io_posix.h not declearing errno, · d6219e4d
      sdong 提交于
      Summary: Mac build breaks as include/posix/io_posix.h doesn't include errno. Move the exact function declaration to io_posix.cc
      
      Test Plan: Run all test. Will run on Mac
      
      Reviewers: rven, anthony, yhchiang, IslamAbdelRahman, igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D49551
      d6219e4d
    • S
      crash_test to trigger some less frequent crash point more frequently · ab0f3b96
      sdong 提交于
      Summary: crash_test still has a very low chance to hit some crash point. Have another mode for covering them more likely.
      
      Test Plan: Run crash_test and see db_stress is called with expected prameters.
      
      Reviewers: kradhakrishnan, igor, anthony, rven, IslamAbdelRahman, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D49473
      ab0f3b96
  11. 27 10月, 2015 1 次提交
    • S
      Avoid some includes in io_posix.h · 44d4057d
      sdong 提交于
      Summary: IO Posix depends on too many .h files. Move most of them to .cc files.
      
      Test Plan: make all
      
      Reviewers: anthony, rven, IslamAbdelRahman, yhchiang, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D49479
      44d4057d
  12. 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
  13. 20 10月, 2015 2 次提交
    • I
      Fix iOS build · 4e07c99a
      Igor Canadi 提交于
      Summary: We don't yet have a CI build for iOS, so our iOS compile gets broken sometimes. Most of the errors are from assumption that size_t is 64-bit, while it's actually 32-bit on some (all?) iOS platforms. This diff fixes the compile.
      
      Test Plan:
      TARGET_OS=IOS make static_lib
      
      Observe there are no warnings
      
      Reviewers: sdong, anthony, IslamAbdelRahman, kradhakrishnan, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D49029
      4e07c99a
    • P
      Handle multiple batches in single log record - allow app to return a new batch... · 0c59691d
      Praveen Rao 提交于
      Handle multiple batches in single log record - allow app to return a new batch + allow app to return corrupted record status
      0c59691d
  14. 19 10月, 2015 2 次提交
  15. 18 10月, 2015 1 次提交
  16. 17 10月, 2015 2 次提交
    • S
      Add more kill points · 277dea78
      sdong 提交于
      Summary:
      Add kill points in:
      1. after creating a file
      2. before writing a manifest record
      3. before syncing manifest
      4. before creating a new current file
      5. after creating a new current file
      
      Test Plan: Run all current tests.
      
      Reviewers: yhchiang, igor, anthony, IslamAbdelRahman, rven, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D48855
      277dea78
    • V
      Moving memtable related files from util to a new directory memtable · a98fbacf
      Venkatesh Radhakrishnan 提交于
      Summary:
      We are cleaning up dependencies.
      This diff takes a first step at moving memtable files to their own
      directory called memtable. In future diffs, we will move other memtable
      files from db to memtable.
      
      Test Plan: make check
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D48915
      a98fbacf
  17. 16 10月, 2015 1 次提交
    • S
      Allow users to disable some kill points in db_stress · e1a5ff85
      sdong 提交于
      Summary:
      Give a name for every kill point, and allow users to disable some kill points based on prefixes. The kill points can be passed by db_stress through a command line paramter. This provides a way for users to boost the chance of triggering low frequency kill points
      This allow follow up changes in crash test scripts to improve crash test coverage.
      
      Test Plan:
      Manually run db_stress with variable values of --kill_random_test and --kill_prefix_blacklist. Like this:
       --kill_random_test=2 --kill_prefix_blacklist=Posix,WritableFileWriter::Append,WritableFileWriter::WriteBuffered,WritableFileWriter::Sync
      
      Reviewers: igor, kradhakrishnan, rven, IslamAbdelRahman, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D48735
      e1a5ff85
  18. 15 10月, 2015 3 次提交
  19. 14 10月, 2015 3 次提交
    • S
      Seperate InternalIterator from Iterator · 35ad531b
      sdong 提交于
      Summary:
      Separate a new class InternalIterator from class Iterator, when the look-up is done internally, which also means they operate on key with sequence ID and type.
      
      This change will enable potential future optimizations but for now InternalIterator's functions are still the same as Iterator's.
      At the same time, separate the cleanup function to a separate class and let both of InternalIterator and Iterator inherit from it.
      
      Test Plan: Run all existing tests.
      
      Reviewers: igor, yhchiang, anthony, kradhakrishnan, IslamAbdelRahman, rven
      
      Reviewed By: rven
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D48549
      35ad531b
    • P
      Put wal_filter under #ifndef ROCKSDB_LITE · cc4d13e0
      Praveen Rao 提交于
      cc4d13e0
    • Y
      Make perf_context.db_mutex_lock_nanos and db_condition_wait_nanos only measures DB Mutex · 7062d0ea
      Yueh-Hsuan Chiang 提交于
      Summary:
      In the current implementation, perf_context.db_mutex_lock_nanos and
      perf_context.db_condition_wait_nanos also include the mutex-wait time
      other than DB Mutex.
      
      This patch fix this issue by incrementing the counters only when it detects
      a DB mutex.
      
      Test Plan: perf_context_test
      
      Reviewers: anthony, IslamAbdelRahman, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D48555
      7062d0ea
  20. 13 10月, 2015 1 次提交