1. 27 2月, 2015 1 次提交
    • M
      Support builds for MongoDB+RocksDB · 1e06a406
      Mark Callaghan 提交于
      Summary:
      This changes the RocksDB build to share headers provided by MongoDB. It is invoked as:
        ROCKSDB_FOR_MONGO=/path/to/mongodb/root make static_lib
      
      Task ID: #
      
      Blame Rev:
      
      Test Plan:
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D34071
      1e06a406
  2. 26 2月, 2015 7 次提交
    • A
      Merge pull request #508 from fyrz/RocksJava-Final-Patch · b74ad663
      Adam Retter 提交于
      [RocksJava] Final usage correction
      b74ad663
    • K
      Disable pre-fetching of index and filter blocks for sst_dump_tool. · d9f4875e
      krad 提交于
      Summary:
      BlockBasedTable pre-fetches the filter and index blocks on Open call.
      This is an optimistic optimization targeted for runtime scenario. The
      optimization is unnecessary for sst_dump_tool
      
      - Added a provision to disable pre-fetching of index and filter blocks
        in BlockBasedTable
      - Disabled pre-fetching for the sst_dump tool
      
      Stack for reference :
      
      #01  0x00000000005ed944 in snappy::InternalUncompress<snappy::SnappyArrayWriter> () from /home/engshare/third-party2/snappy/1.0.3/src/snappy-1.0.3/snappy.cc:148
      #02  0x00000000005edeee in snappy::RawUncompress () from /home/engshare/third-party2/snappy/1.0.3/src/snappy-1.0.3/snappy.cc:947
      #03  0x00000000004e0b4d in rocksdb::UncompressBlockContents () from /data/users/paultuckfield/rocksdb/./util/compression.h:69
      #04  0x00000000004e145c in rocksdb::ReadBlockContents () from /data/users/paultuckfield/rocksdb/table/format.cc:334
      #05  0x00000000004ca424 in rocksdb::(anonymous namespace)::ReadBlockFromFile () from /data/users/paultuckfield/rocksdb/table/block_based_table_reader.cc:70
      #06  0x00000000004cccad in rocksdb::BlockBasedTable::CreateIndexReader () from /data/users/paultuckfield/rocksdb/table/block_based_table_reader.cc:173
      #07  0x00000000004d17e5 in rocksdb::BlockBasedTable::Open () from /data/users/paultuckfield/rocksdb/table/block_based_table_reader.cc:553
      #08  0x00000000004c8184 in rocksdb::BlockBasedTableFactory::NewTableReader () from /data/users/paultuckfield/rocksdb/table/block_based_table_factory.cc:51
      #09  0x0000000000598463 in rocksdb::SstFileReader::NewTableReader () from /data/users/paultuckfield/rocksdb/util/sst_dump_tool.cc:69
      #10  0x00000000005986c2 in rocksdb::SstFileReader::SstFileReader () from /data/users/paultuckfield/rocksdb/util/sst_dump_tool.cc:26
      #11  0x0000000000599047 in rocksdb::SSTDumpTool::Run () from /data/users/paultuckfield/rocksdb/util/sst_dump_tool.cc:332
      #12  0x0000000000409b06 in main () from /data/users/paultuckfield/rocksdb/tools/sst_dump.cc:12
      
      Test Plan:
      - Added a unit test to trigger the code.
      - Also did some manual verification.
      - Passed all unit tests
      
      task #6296048
      
      Reviewers: igor, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34041
      d9f4875e
    • M
      Limit key range to number of keys, not number of writes · 182b4cea
      Mark Callaghan 提交于
      Summary:
      An old commit (482401) changed DoWrite to use the value of --writes rather
      than --num to determine the range for keys. This restores the old and correct
      behavior which is to limit it using --num.
      
      Task ID: #6353043
      
      Blame Rev:
      
      Test Plan:
      run db_bench
      
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D34065
      182b4cea
    • I
      Merge pull request #516 from fyrz/RocksJava-Update-Statistics-To-3.10 · a360bb61
      Igor Canadi 提交于
      [RocksJava] Updated TickerTypes and Histogram to 3.10
      a360bb61
    • F
      [RocksJava] Updated TickerTypes and Histogram to 3.10 · 8c768447
      fyrz 提交于
      Updated tickers and histogram types to 3.10.
      8c768447
    • F
      [RocksJava] Integrated changes from D33417 · 7f0c77cb
      fyrz 提交于
      7f0c77cb
    • F
      [RocksJava] Final usage correction · 819e787b
      fyrz 提交于
      Summary:
      Introduced final keyword to parameters with immutable values and classes
      which should not be derived.
      
      Test Plan:
      make rocksdbjava
      make jtest
      
      Reviewers: yhchiang, adamretter, ankgup87
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33417
      819e787b
  3. 25 2月, 2015 8 次提交
  4. 24 2月, 2015 6 次提交
  5. 21 2月, 2015 8 次提交
    • J
      build: enable more compiler warnings · 4f514a53
      Jim Meyering 提交于
      Summary:
      * Makefile (WARNING_FLAGS): Add -W and -Wextra, and at least for now,
      -Wno-unused-parameter.  Without that latter one, there would be
      many errors/warnings about unused parameters.
      
      Test Plan:
      run these and ensure there is no warning:
        make clean && make
        make clean && USE_CLANG=1 make
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33819
      4f514a53
    • J
      inputs: restore "const" attribute removed by D33759 · a2b911b6
      Jim Meyering 提交于
      Summary:
      The "const" attribute applies to the type, and placing it
      before that return type retains the desired semantics,
      yet avoids the compiler error/warning.
      
      Test Plan: Run make
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33789
      a2b911b6
    • J
      mark as unused some variables with cpp-derived names · 1b408258
      Jim Meyering 提交于
      Summary: as above
      
      Test Plan:
        Run "make EXTRA_CXXFLAGS='-W -Wextra'" and see fewer errors.
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33753
      1b408258
    • J
      fix erroneous assert: cast kBlockSize (of type unsigned int) to "int" · c6d54b50
      Jim Meyering 提交于
      Summary:
      Otherwise, we would assert that an unsigned expression is always >= 0.
      The intent was to form a possibly negative number, and to assert that
      that value is always >= 0, but since one variable in the computation
      was unsigned, the result was guaranteed to be unsigned, too, rendering
      the assertion useless.
      
      Cast that unsigned variable to "int", so that all operands
      are signed, and thus so that the result can be negative.
      
      Test Plan:
        Run "make EXTRA_CXXFLAGS='-W -Wextra'" and see fewer errors.
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33771
      c6d54b50
    • J
      table_test.cc: add missing 5th arg in TestArgs initializer · aa5d8e6d
      Jim Meyering 提交于
      Summary:
      Adding -W and -Wextra to CXXFLAGS provoked this failure:
      
      	  table/table_test.cc:1854:56: error: missing initializer for member ‘rocksdb::TestArgs::format_version’ [-Werror=missing-field-initializers]
      	     TestArgs args = { DB_TEST, false, 16, kNoCompression };
      	                                                          ^
      
      Add the missing, 5th value (format_version).
      
      Test Plan:
        Run "make EXTRA_CXXFLAGS='-W -Wextra'" and see fewer errors.
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33765
      aa5d8e6d
    • J
      maint: remove extraneous "const" attribute from return type · c37937a9
      Jim Meyering 提交于
      Summary:
      The "const" attribute does not make sense on a return type,
      and provokes a warning/error from gcc -W -Wextra.
      
      Test Plan:
        Run "make EXTRA_CXXFLAGS='-W -Wextra'" and see fewer errors.
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33759
      c37937a9
    • J
      build: remove always-true assertions · 9283c7af
      Jim Meyering 提交于
      Summary:
      Remove some always-true assertions.
      They provoke these compilation failures:
      
        table/plain_table_key_coding.cc:279:20: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
        db/version_set.cc:336:15: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
      
      * table/plain_table_key_coding.cc (rocksdb): Remove assertion that
      unsigned type variable is >= 0.
      * db/version_set.cc (DoGenerateLevelFilesBrief): Likewise.
      
      Test Plan:
        Run "make EXTRA_CXXFLAGS='-W -Wextra'" and see fewer errors.
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33747
      9283c7af
    • I
      Adding Flush to AutoRollLogger · 06a766de
      Islam AbdelRahman 提交于
      Summary:
      During running AutoRollLoggerTest on FreeBSD we have found out that AutoRollLogger is not flushing correctly (test fails on FreeBSD)
      This diff add Flush to AutoRollLogger to fix this problem
      
      Test Plan:
      [My machine] make all check ( all tests pass)
      [FreeBSD VM] running AutoRollLoggerTest ( all tests pass )
      
      Reviewers: sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33633
      06a766de
  6. 20 2月, 2015 7 次提交
    • I
      Fix mac build · 92416fa7
      Igor Canadi 提交于
      92416fa7
    • I
      GetOptionsFromString + fixes to block_based_table_options · 96ab15d3
      Igor Canadi 提交于
      Summary:
      In mongo, we currently have a single column family and I'd like to support setting rocksdb::Options from string. This diff provides an option to GetOptionsFromString()
      
      There's one more problem. Currently GetColumnFamilyOptionsFromString() overwrites block_based options. In mongo I set default values for block_cache and some other values of BlockBasedTableOptions and I don't want them reset to default with GetOptionsFromString().
      
      Test Plan: added unit test
      
      Reviewers: yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33729
      96ab15d3
    • I
      rocksdb: Fix scan-build bug 'Memory leak' in db/db_bench.cc · 73711f95
      Igor Sugak 提交于
      Summary:
      The bug is detected by scan-build.
      
      In `void WriteSeqSeekSeq(ThreadState* thread)` memory is allocated in line 3118 `Slice key = AllocateKey();` but `Slice` is not responsible deleting `Slice::data()`.
      
      Added `std::unique_ptr<const char[]>*` parameter to ` AllocateKey()`, so that it requires caller to not forget about Slice::data() management.
      
      scan-build bug report: http://home.fburl.com/~sugak/latest6/report-6e9754.html#EndPath
      
      Test Plan:
      Make sure scan-build does not report 'Memory leak' in db/db_bench.cc and all tests are passing.
      ```lang=bash
      % make analyze
      % make check
      ```
      
      Reviewers: lgalanis, igor, meyering, sdong
      
      Reviewed By: meyering, sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33501
      73711f95
    • I
      rocksdb: Fix scan-build memory warning in table/block_based_table_reader.cc · 98870c7b
      Igor Sugak 提交于
      Summary:
      scan-build is reporting two memory leak bugs in `table/block_based_table_reader.cc`. They are both false positives. In both cases we allocate memory in `ReadBlockFromFile` if `s.ok()`. Then after the function `ReadBlockFromFile` returns we check for the same variable if `s.ok()` and then use the memory that was allocated. The bugs reported by scan-build is if `ReadBlockFromFile` allocates memory and returns, but for some reason status `s` is not the same and `s.ok() != true`.
      
      In this case scan-build is concerned that memory owner transfer is not explicit. I modified `ReadBlockFromFile` to accept `std::unique_ptr<Block>*` as a parameter, instead of raw pointer.
      
      scan-build reports:
      http://home.fburl.com/~sugak/latest2/report-a4b3fa.html#EndPath
      http://home.fburl.com/~sugak/latest2/report-29adbf.html#EndPath
      
      Test Plan:
      Make sure scan-build does not report these bugs and all tests are passing.
      ```lang=bash
      % make check
      % make analyze
      ```
      
      Reviewers: sdong, lgalanis, meyering, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33681
      98870c7b
    • J
      build: do not relink every single binary just for a timestamp · a42324e3
      Jim Meyering 提交于
      Summary:
      Prior to this change, "make check" would always waste a lot of
      time relinking 60+ binaries. With this change, it does that
      only when the generated file, util/build_version.cc, changes,
      and that happens only when the date changes or when the
      current git SHA changes.
      
      This change makes some other improvements: before, there was no
      rule to build a deleted util/build_version.cc. If it was somehow
      removed, any attempt to link a program would fail.
      There is no longer any need for the separate file,
      build_tools/build_detect_version.  Its functionality is
      now in the Makefile.
      
      * Makefile (DEPFILES): Don't filter-out util/build_version.cc.
      No need, and besides, removing that dependency was wrong.
      (date, git_sha, gen_build_version): New helper variables.
      (util/build_version.cc): New rule, to create this file
      and update it only if it would contain new information.
      * build_tools/build_detect_platform: Remove file.
      * db/db_impl.cc: Now, print only date (not the time).
      * util/build_version.h (rocksdb_build_compile_time): Remove
      declaration.  No longer used.
      
      Test Plan:
      - Run "make check" twice, and note that the second time no linking is performed.
      - Remove util/build_version.cc and ensure that any "make"
      command regenerates it before doing anything else.
      - Run this: strings librocksdb.a|grep _build_.
      That prints output including the following:
      
        rocksdb_build_git_date:2015-02-19
        rocksdb_build_git_sha:2.8.fb-1792-g3cb6cc0
      
      Reviewers: ljin, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33591
      a42324e3
    • S
      Add rocksdb.num-live-versions: number of live versions · d45a6a40
      sdong 提交于
      Summary: Add a DB property about live versions. It can be helpful to figure out whether there are files not live but not yet deleted, in some use cases.
      
      Test Plan: make all check
      
      Reviewers: rven, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: yoshinorim, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33327
      d45a6a40
    • J
      build: abbreviate AR command, too · 11581b74
      Jim Meyering 提交于
      Summary:
      The "ar" command was excessively verbose.
      This abbreviates it to be like CC and LD.
      Also, factor "rs" options into ARFLAGS.
      
      Test Plan:
        $ rm librocksdb.a
        $ make librocksdb.a
        AR       librocksdb.a
        ar: creating librocksdb.a
      
      Reviewers: ljin, sdong, igor.sugak, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D33699
      11581b74
  7. 19 2月, 2015 3 次提交
    • I
      Revert "Fbson to Json" · b8ac71ba
      Igor Canadi 提交于
      This reverts commit 7ce1b2c1.
      b8ac71ba
    • S
      Fbson to Json · 7ce1b2c1
      stash93 提交于
      Summary: Replaced rapidjson with fbson
      
      Test Plan:
      make all check
      make valgrind_check
      
      Reviewers: golovachalexander, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D32733
      7ce1b2c1
    • V
      Managed iterator · 7d817268
      Venkatesh Radhakrishnan 提交于
      Summary:
      This is a diff for managed iterator. A managed iterator
      is a wrapper around an iterator which saves the options for that
      iterator as well as the current key/value so that the underlying iterator
      and its associated memory can be released when it is aged out
      automatically or on the request of the user. Will provide the automatic release as a follow-up diff.
      
      Test Plan: Managed* tests in db_test and XF tests for managed iterator
      
      Reviewers: igor, yhchiang, anthony, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D31401
      7d817268