1. 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
  2. 07 11月, 2015 4 次提交
  3. 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
  4. 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
  5. 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
  6. 31 10月, 2015 1 次提交
  7. 29 10月, 2015 1 次提交
    • I
      Write stress test · 4b66d953
      Igor Canadi 提交于
      Summary:
      The goal of this diff is to create a simple stress test with focus on catching:
      * bugs in compaction/flush processes, especially the ones that cause assertion errors
      * bugs in the code that deletes obsolete files
      
      There are two parts of the test:
      * write_stress, a binary that writes to the database
      * write_stress_runner.py, a script that invokes and kills write_stress
      
      Here are some interesting parts of write_stress:
      * Runs with very high concurrency of compactions and flushes (32 threads total) and tries to create a huge amount of small files
      * The keys written to the database are not uniformly distributed -- there is a 3-character prefix that mutates occasionally (in prefix mutator thread), in such a way that the first character mutates slower than second, which mutates slower than third character. That way, the compaction stress tests some interesting compaction features like trivial moves and bottommost level calculation
      * There is a thread that creates an iterator, holds it for couple of seconds and then iterates over all keys. This is supposed to test RocksDB's abilities to keep the files alive when there are references to them.
      * Some writes trigger WAL sync. This is stress testing our WAL sync code.
      * At the end of the run, we make sure that we didn't leak any of the sst files
      
      write_stress_runner.py changes the mode in which we run write_stress and also kills and restarts it. There are some interesting characteristics:
      * At the beginning we divide the full test runtime into smaller parts -- shorter runtimes (couple of seconds) and longer runtimes (100, 1000) seconds
      * The first time we run write_stress, we destroy the old DB. Every next time during the test, we use the same DB.
      * We can run in kill mode or clean-restart mode. Kill mode kills the write_stress violently.
      * We can run in mode where delete_obsolete_files_with_fullscan is true or false
      * We can run with low_open_files mode turned on or off. When it's turned on, we configure table cache to only hold a couple of files -- that way we need to reopen files every time we access them.
      
      Another goal was to create a stress test without a lot of parameters. So tools/write_stress_runner.py should only take one parameter -- runtime_sec and it should figure out everything else on its own.
      
      In a separate diff, I'll add this new test to our nightly legocastle runs.
      
      Test Plan:
      The goal of this test was to retroactively catch the following bugs: D33045, D48201, D46899, D42399. I failed to reproduce D48201, but all others have been caught!
      
      When i reverted https://reviews.facebook.net/D33045:
      
           ./write_stress --runtime_sec=200 --low_open_files_mode=true
           Iterator statuts not OK: IO error: /fast-rocksdb-tmp/rocksdb_test/write_stress/089166.sst: No such file or directory
      
      When i reverted https://reviews.facebook.net/D42399:
      
          python tools/write_stress_runner.py --runtime_sec=5000
          Running write_stress, will kill after 5 seconds: ./write_stress --runtime_sec=-1
          Running write_stress, will kill after 2 seconds: ./write_stress --runtime_sec=-1 --destroy_db=false --delete_obsolete_files_with_fullscan=true
          Running write_stress, will kill after 7 seconds: ./write_stress --runtime_sec=-1 --destroy_db=false
          Running write_stress, will kill after 5 seconds: ./write_stress --runtime_sec=-1 --destroy_db=false
          Running write_stress, will kill after 8 seconds: ./write_stress --runtime_sec=-1 --destroy_db=false --low_open_files_mode=true
          Write to DB failed: IO error: /fast-rocksdb-tmp/rocksdb_test/write_stress/019250.sst: No such file or directory
          ERROR: write_stress died with exitcode=-6
      
      When i reverted https://reviews.facebook.net/D46899:
      
          python tools/write_stress_runner.py --runtime_sec=1000
          runtime: 1000
          Going to execute write stress for [3, 3, 100, 3, 2, 100, 1, 788]
          Running write_stress for 3 seconds: ./write_stress --runtime_sec=3 --low_open_files_mode=true
          Running write_stress for 3 seconds: ./write_stress --runtime_sec=3 --destroy_db=false --delete_obsolete_files_with_fullscan=true
          Running write_stress, will kill after 100 seconds: ./write_stress --runtime_sec=-1 --destroy_db=false --delete_obsolete_files_with_fullscan=true
          write_stress: db/db_impl.cc:2070: void rocksdb::DBImpl::MarkLogsSynced(uint64_t, bool, const rocksdb::Status&): Assertion `log.getting_synced' failed.
          ERROR: write_stress died with exitcode=-6
      
      Reviewers: IslamAbdelRahman, yhchiang, rven, kradhakrishnan, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D49533
      4b66d953
  8. 21 10月, 2015 2 次提交
    • D
      Do not build test only code and unit tests in Release builds · e154ee08
      Dmitri Smirnov 提交于
        Test code errors are currently blocking Windows Release builew
        We do not want spend time building in Release what we can not run
        We want to eliminate a source of most frequent errors when people
        check-in test only code which can not be built in Release.
        This feature will work only if you invoke msbuild against rocksdb.sln
        Invoking it against ALL_BUILD target will attempt to build everything.
      e154ee08
    • V
      Error while cmake by building from zip-archive · cd3286fa
      Vasili Svirski 提交于
      * add validation is git found
      * add validation is .git folder exists in project (project zip archive download without .git folder)
      * get head commit SHA if git found and .git folder exists
      
      Tested:
      * configure project by CMake 3.0.0 successfully (with and without git), with project zip archive (without .git folder) and with project cloned from github
      * configure project by command: cmake -G "Visual Studio 12 Win64"
      * build solution by Visual Studio
      * manually validate that file utils/build_version.cc contains valid head revision value
      cd3286fa
  9. 18 10月, 2015 1 次提交
  10. 17 10月, 2015 1 次提交
  11. 15 10月, 2015 3 次提交
  12. 13 10月, 2015 1 次提交
  13. 07 10月, 2015 1 次提交
  14. 01 10月, 2015 1 次提交
  15. 30 9月, 2015 2 次提交
    • Y
      RocksDB Options file format and its serialization / deserialization. · 74b100ac
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch defines the format of RocksDB options file, which
      follows the INI file format, and implements functions for its
      serialization and deserialization.  An example RocksDB options
      file can be found in examples/rocksdb_option_file_example.ini.
      
      A typical RocksDB options file has three sections, which are
      Version, DBOptions, and more than one CFOptions.  The RocksDB
      options file in general follows the basic INI file format
      with the following extensions / modifications:
       * Escaped characters
         We escaped the following characters:
          - \n -- line feed - new line
          - \r -- carriage return
          - \\ -- backslash \
          - \: -- colon symbol :
          - \# -- hash tag #
       * Comments
         We support # style comments.  Comments can appear at the ending
         part of a line.
       * Statements
         A statement is of the form option_name = value.
         Each statement contains a '=', where extra white-spaces
         are supported. However, we don't support multi-lined statement.
         Furthermore, each line can only contain at most one statement.
       * Section
         Sections are of the form [SecitonTitle "SectionArgument"],
         where section argument is optional.
       * List
         We use colon-separated string to represent a list.
         For instance, n1:n2:n3:n4 is a list containing four values.
      
      Below is an example of a RocksDB options file:
      
      [Version]
        rocksdb_version=4.0.0
        options_file_version=1.0
      [DBOptions]
        max_open_files=12345
        max_background_flushes=301
      [CFOptions "default"]
      [CFOptions "the second column family"]
      [CFOptions "the third column family"]
      
      Test Plan: Added many tests in options_test.cc
      
      Reviewers: igor, IslamAbdelRahman, sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: maykov, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D46059
      74b100ac
    • D
      Improve CI build and build switches · 2e7506d8
      Dmitri Smirnov 提交于
        Add an optimized build config switch for faster test runs
        Change compiler options to introduce more opitmizations and be more inline with MS internal switches.
        Make appveyor build to utilize all the avaiable cores on the VM (parallel)
        Introduce new appveyor configuration for daily test runs as it would take too long
        to run db_test after each checkin even in paralell.
        With some exclusions we make it in 38 minutes. We currently fail to install ramdisk during the build.
        Add a powershell script to faicilitate paralell run for db_test cases.
      2e7506d8
  16. 24 9月, 2015 1 次提交
    • A
      Remove ldb HexToString method's usage of sscanf · 4805fa0e
      Assaf Sela 提交于
      Summary:
      Fix hex2String performance issues by removing sscanf dependency.
      Also fixed some edge case handling (odd length, bad input).
      
      Test Plan: Created a test file which called old and new implementation, and validated results are the same. I'll paste results in the phabricator diff.
      
      Reviewers: igor, rven, anthony, IslamAbdelRahman, kradhakrishnan, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: thatsafunnyname, leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D46785
      4805fa0e
  17. 11 9月, 2015 1 次提交
    • A
      Refactored common code of Builder/CompactionJob out into a CompactionIterator · 8aa1f151
      Andres Noetzli 提交于
      Summary:
      Builder and CompactionJob share a lot of fairly complex code. This patch
      refactors this code into a separate class, the CompactionIterator. Because the
      shared code is fairly complex, this patch hopefully improves maintainability.
      While there are is a lot of potential for further improvements, the patch is
      intentionally pretty close to the original structure because the change is
      already complex enough.
      
      Test Plan: make clean all check && ./db_stress
      
      Reviewers: rven, anthony, yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D46197
      8aa1f151
  18. 09 9月, 2015 1 次提交
    • A
      TransactionDB Custom Locking API · 5e94f68f
      agiardullo 提交于
      Summary:
      Prototype of API to allow MyRocks to override default Mutex/CondVar used by transactions with their own implementations.  They would simply need to pass their own implementations of Mutex/CondVar to the templated TransactionDB::Open().
      
      Default implementation of TransactionDBMutex/TransactionDBCondVar provided (but the code is not currently changed to use this).
      
      Let me know if this API makes sense or if it should be changed
      
      Test Plan: n/a
      
      Reviewers: yhchiang, rven, igor, sdong, spetrunia
      
      Reviewed By: spetrunia
      
      Subscribers: maykov, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D43761
      5e94f68f
  19. 01 9月, 2015 1 次提交
    • A
      Support static Status messages · 77a28615
      agiardullo 提交于
      Summary: Provide a way to specify a detailed static error message for a Status without incurring a memcpy.  Let me know what people think of this approach.
      
      Test Plan: added simple test
      
      Reviewers: igor, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D44259
      77a28615
  20. 26 8月, 2015 1 次提交
  21. 25 8月, 2015 1 次提交
    • A
      Common base class for transactions · 20d1e547
      agiardullo 提交于
      Summary:
      As I keep adding new features to transactions, I keep creating more duplicate code.  This diff cleans this up by creating a base implementation class for Transaction and OptimisticTransaction to inherit from.
      
      The code in TransactionBase.h/.cc is all just copied from elsewhere.  The only entertaining part of this class worth looking at is the virtual TryLock method which allows OptimisticTransactions and Transactions to share the same common code for Put/Get/etc.
      
      The rest of this diff is mostly red and easy on the eyes.
      
      Test Plan: No functionality change.  existing tests pass.
      
      Reviewers: sdong, jkedgar, rven, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D45135
      20d1e547
  22. 12 8月, 2015 2 次提交
    • A
      Pessimistic Transactions · c2f2cb02
      agiardullo 提交于
      Summary:
      Initial implementation of Pessimistic Transactions.  This diff contains the api changes discussed in D38913.  This diff is pretty large, so let me know if people would prefer to meet up to discuss it.
      
      MyRocks folks:  please take a look at the API in include/rocksdb/utilities/transaction[_db].h and let me know if you have any issues.
      
      Also, you'll notice a couple of TODOs in the implementation of RollbackToSavePoint().  After chatting with Siying, I'm going to send out a separate diff for an alternate implementation of this feature that implements the rollback inside of WriteBatch/WriteBatchWithIndex.  We can then decide which route is preferable.
      
      Next, I'm planning on doing some perf testing and then integrating this diff into MongoRocks for further testing.
      
      Test Plan: Unit tests, db_bench parallel testing.
      
      Reviewers: igor, rven, sdong, yhchiang, yoshinorim
      
      Reviewed By: sdong
      
      Subscribers: hermanlee4, maykov, spetrunia, leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D40869
      c2f2cb02
    • A
      Fix Windows build by adding snapshot_impl to CMakeLists · 6b2d5703
      agiardullo 提交于
      Test Plan: untested
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D44049
      6b2d5703
  23. 06 8月, 2015 2 次提交
    • S
      Add util/delete_scheduler_impl.cc to CMakeLists.txt · 48e6e9aa
      sdong 提交于
      Summary: util/delete_scheduler_impl.cc is missing CMakeLists.txt, which fails Windows build. Add it.
      
      Test Plan: Build in both of Windows and Linux
      
      Reviewers: anthony, rven, yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D43641
      48e6e9aa
    • S
      Add two unit tests for SyncWAL() · 7ccd1c80
      sdong 提交于
      Summary:
      Add two unit tests for SyncWAL(). One makes sure SyncWAL() doesn't block writes in the other thread. Another one makes sure SyncWAL() doesn't wait ongoing writes to finish before being executed.
      
      Create a new test file db_wal_test and move two WAL related tests from db_test to here.
      
      Test Plan: Run the new tests
      
      Reviewers: IslamAbdelRahman, rven, kradhakrishnan, kolmike, tnovak, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D43605
      7ccd1c80
  24. 04 8月, 2015 1 次提交
    • Y
      Add CompactOnDeletionCollector in utilities/table_properties_collectors. · 26894303
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff adds CompactOnDeletionCollector in utilities/table_properties_collectors,
      which applies a sliding window to a sst file and mark this file as need-compaction
      when it observe enough deletion entries within the consecutive keys covered by
      the sliding window.
      
      Test Plan: compact_on_deletion_collector_test
      
      Reviewers: igor, anthony, IslamAbdelRahman, kradhakrishnan, yoshinorim, sdong
      
      Reviewed By: sdong
      
      Subscribers: maykov, dhruba
      
      Differential Revision: https://reviews.facebook.net/D41175
      26894303
  25. 22 7月, 2015 3 次提交
    • D
      Add missing tests, fix db_sanity · 31b35c90
      Dmitri Smirnov 提交于
       Add heap_test, merge_helper_test
       Fix uninitialized pointers in db_sanity_test that cause SIGSEV when DB::Open fails in case compression is not linked.
      31b35c90
    • D
      Fix windows build after refactoring · ac5e441a
      Dmitri Smirnov 提交于
        Missing and duplicate files in CMake
        Missing definition of port::Crash
      ac5e441a
    • S
      RangeSync not to sync last 1MB of the file · 3dbf4ba2
      Siying Dong 提交于
      Summary:
      From other ones' investigation:
      
      "sync_file_range() behavior highly depends on kernel version and filesystem.
      
      xfs does neighbor page flushing outside of the specified ranges. For example, sync_file_range(fd, 8192, 16384) does not only trigger flushing page #3 to #4, but also flushing many more dirty pages (i.e. up to page#16)... Ranges of the sync_file_range() should be far enough from write() offset (at least 1MB)."
      
      Test Plan: make all check
      
      Reviewers: igor, rven, kradhakrishnan, yhchiang, IslamAbdelRahman, anthony
      
      Reviewed By: anthony
      
      Subscribers: yoshinorim, MarkCallaghan, sumeet, domas, dhruba, leveldb, ljin
      
      Differential Revision: https://reviews.facebook.net/D15807
      3dbf4ba2
  26. 21 7月, 2015 3 次提交
  27. 17 7月, 2015 1 次提交
    • D
      Ensure Windows build w/o port/port.h in public headers · d1a45718
      Dmitri Smirnov 提交于
       - Remove make file defines from public headers and use _WIN32 because it is compiler defined
       - use __GNUC__ and __clang__ to guard non-portable attributes
       - add #include "port/port.h" to some new .cc files.
       - minor changes in CMakeLists to reflect recent changes
      d1a45718