1. 18 7月, 2015 4 次提交
    • A
      Fix ROCKSDB_WARNING · 79373c37
      agiardullo 提交于
      Summary:
      ROCKSDB_WARNING is only defined if either ROCKSDB_PLATFORM_POSIX or OS_WIN is defined.  This works well for building rocksdb with its own build scripts.  But this won't work when an outside project(like mongodb) doesn't define ROCKSDB_PLATFORM_POSIX.
      
      This fix defines ROCKSDB_WARNING for all platforms.  No idea if its defined correctly on non-posix,non-windows platforms but this is no worse that the current situation where this macro is missing on unexpected platforms.
      
      This fix should hopefully fix anyone whose build broke now that we've switched from using #warning to Pragma (to support windows).  Unfortunately, while mongo-rocks compiles, it ignores the Pragma and doesn't print a warning.  I have not been able to figure out a way to implement this portably on all platforms.
      
      Of course, an alternate solution would be to just get rid of ROCKSDB_WARNING and live with include file redirects indefinitely.  Thoughts?
      
      Test Plan: build rocks, build mongorocks
      
      Reviewers: igor, kradhakrishnan, IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42477
      79373c37
    • A
      Added JSON manifest dump option to ldb command · 74c755c5
      Ari Ekmekji 提交于
      Summary:
      Added a new flag --json to the ldb manifest_dump command
      that prints out the version edits as JSON objects for easier
      reading and parsing of information.
      
      Test Plan:
      **Sample usage: **
      ```
      ./ldb manifest_dump --json --path=path/to/manifest/file
      ```
      
      **Sample output:**
      ```
      {"EditNumber": 0, "Comparator": "leveldb.BytewiseComparator", "ColumnFamily": 0}
      {"EditNumber": 1, "LogNumber": 0, "ColumnFamily": 0}
      {"EditNumber": 2, "LogNumber": 4, "PrevLogNumber": 0, "NextFileNumber": 7, "LastSeq": 35356, "AddedFiles": [{"Level": 0, "FileNumber": 5, "FileSize": 1949284, "SmallestIKey": "'", "LargestIKey": "'"}], "ColumnFamily": 0}
      ...
      {"EditNumber": 13, "PrevLogNumber": 0, "NextFileNumber": 36, "LastSeq": 290994, "DeletedFiles": [{"Level": 0, "FileNumber": 17}, {"Level": 0, "FileNumber": 20}, {"Level": 0, "FileNumber": 22}, {"Level": 0, "FileNumber": 24}, {"Level": 1, "FileNumber": 13}, {"Level": 1, "FileNumber": 14}, {"Level": 1, "FileNumber": 15}, {"Level": 1, "FileNumber": 18}], "AddedFiles": [{"Level": 1, "FileNumber": 25, "FileSize": 2114340, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 26, "FileSize": 2115213, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 27, "FileSize": 2114807, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 30, "FileSize": 2115271, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 31, "FileSize": 2115165, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 32, "FileSize": 2114683, "SmallestIKey": "'", "LargestIKey": "'"}, {"Level": 1, "FileNumber": 35, "FileSize": 1757512, "SmallestIKey": "'", "LargestIKey": "'"}], "ColumnFamily": 0}
      ...
      ```
      
      Reviewers: sdong, anthony, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D41727
      74c755c5
    • I
      Deprecate CompactionFilterV2 · a96fcd09
      Igor Canadi 提交于
      Summary: It has been around for a while and it looks like it never found any uses in the wild. It's also complicating our compaction_job code quite a bit. We're deprecating it in 3.13, but will put it back in 3.14 if we actually find users that need this feature.
      
      Test Plan: make check
      
      Reviewers: noetzli, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42405
      a96fcd09
    • A
      Fixed and simplified merge_helper · 1d20fa9d
      Andres Notzli 提交于
      Summary:
      MergeUntil was not reporting a success when merging an operand with
      a Value/Deletion despite the comments in MergeHelper and CompactionJob
      indicating otherwise. This lead to operands being written to the compaction
      output unnecessarily:
      
      M1 M2 M3 P M4 M5 --> (P+M1+M2+M3) M2 M3 M4 M5 (before the diff)
      M1 M2 M3 P M4 M5 --> (P+M1+M2+M3) M4 M5 (after the diff)
      
      In addition, the code handling Values/Deletion was basically identical.
      This patch unifies the code. Finally, this patch also adds testing for
      merge_helper.
      
      Test Plan: make && make check
      
      Reviewers: sdong, rven, yhchiang, tnovak, igor
      
      Reviewed By: igor
      
      Subscribers: tnovak, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42351
      1d20fa9d
  2. 17 7月, 2015 7 次提交
    • S
      Merge pull request #656 from qinzuoyan/fb-master · aede5cd8
      Siying Dong 提交于
      fix append bug in DumpDBFileSummary()
      aede5cd8
    • S
      Merge pull request #657 from yuslepukhin/ensure_clean_public_headers · d730c367
      Siying Dong 提交于
      Ensure Windows build w/o port/port.h in public headers
      d730c367
    • S
      Fix a typo in variable · ac2b9367
      sdong 提交于
      Summary: Typo seqeuntial -> sequential in db/fault_injection_test.cc
      
      Test Plan: Build it
      
      Reviewers: ott, igor, anthony, kradhakrishnan, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D42417
      ac2b9367
    • D
      Merge after rebasing · 415c4732
      Dmitri Smirnov 提交于
      415c4732
    • 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
    • S
      Fix data loss after DB recovery by not allowing flush/compaction to be scheduled until DB opened · 6c0c8dee
      sdong 提交于
      Summary:
      Previous run may leave some SST files with higher file numbers than manifest indicates.
      Compaction or flush may start to run while DB::Open() is still going on. SST file garbage collection may happen interleaving with compaction or flush, and overwrite files generated by compaction of flushes after they are generated. This might cause data loss. This possibility of interleaving is recently introduced.
      Fix it by not allowing compaction or flush to be scheduled before DB::Open() finishes.
      
      Test Plan: Add a unit test. This verification will have a chance to fail without the fix but doesn't fix without the fix.
      
      Reviewers: kradhakrishnan, anthony, yhchiang, IslamAbdelRahman, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42399
      6c0c8dee
    • A
      Test for compaction of corrupted keys · e4af3bfb
      Andres Notzli 提交于
      Summary:
      Fixes T7697334. Adds a simple test to check whether CompactionJob deals
      with corrupted keys correctly. Right now, we preserve corrupted keys.
      Note: depending on the type of corruption and options like comparators,
      CompactionJob fails. This test just checks whether corrupted keys that
      do not fail CompactionJob are preserved.
      
      Test Plan:
      `make compaction_job_test && ./compaction_job_test` -> Tests pass.
      Add `input->Next(); continue;` in CompactionJob::ProcessKeyValueCompaction()
      inside then-branch of `!ParseInternalKey(key, &ikey)` -> Tests fail.
      
      Reviewers: sdong, rven, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42237
      e4af3bfb
  3. 16 7月, 2015 12 次提交
    • I
      Fix compile on Mac · c5bca531
      Igor Canadi 提交于
      Summary: as title
      
      Test Plan: compiles
      
      Reviewers: lovro
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42411
      c5bca531
    • Q
      extend temp str buffer size · 487bba43
      qinzuoyan 提交于
      487bba43
    • D
      Ensure Windows build w/o port/port.h in public headers · 247690fe
      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
      247690fe
    • Q
      fix append bug in DumpDBFileSummary() · 84c3577a
      qinzuoyan 提交于
      84c3577a
    • A
      Fix mongo build -take 2 · 43e98256
      agiardullo 提交于
      Summary: quick fix for now.  will figure out a better fix soon
      
      Test Plan: build
      
      Reviewers: sdong, igor, kradhakrishnan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42381
      43e98256
    • A
      Unbreak mongo build · d8263d95
      agiardullo 提交于
      Summary: Unbreak build for mongo.  later, we'll have to figure out if there is a platform independent way to implement ROCKSDB_WARNING
      
      Test Plan: build
      
      Reviewers: igor, sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42369
      d8263d95
    • I
      Bump to RocksDB 3.13 · 12c5528a
      Igor Canadi 提交于
      Summary: master is now 3.13-to-be. I'm testing some internal stuff that has #ifdef based on RocksDB version.
      
      Test Plan: none
      
      Reviewers: sdong, anthony
      
      Reviewed By: anthony
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42249
      12c5528a
    • A
      move convenience.h out of utilities · 81d07262
      agiardullo 提交于
      Summary: Moved convenience.h out of utilities to remove a dependency on utilities in db.
      
      Test Plan: unit tests.  Also compiled a link to the old location to verify the _Pragma works.
      
      Reviewers: sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42201
      81d07262
    • P
      Fixing delete files in Trivial move of universal compaction · beb19ad0
      Poornima Chozhiyath Raman 提交于
      Summary:
      Trvial move in universal compaction was failing when trying to move files from levels other than 0.
      This was because the DeleteFile while trivially moving, was only deleting files of level 0 which caused duplication of same file in different levels.
      This is fixed by passing the right level as argument in the call of DeleteFile while doing trivial move.
      
      Test Plan: ./db_test ran successfully with the new test cases.
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D42135
      beb19ad0
    • K
      Build fix. · c6139606
      krad 提交于
      Summary: gcc-4.9-glibc-2.20 complains about uninitialized variable.
      
      db/compaction_picker.cc: In member function 'bool
      rocksdb::CompactionPicker::IsInputNonOverlapping(rocksdb::Compaction*)':
      db/compaction_picker.cc:1174:17: error:
      'prev.rocksdb::{anonymous}::InputFileInfo::f' may be used uninitialized in this
      function [-Werror=maybe-uninitialized]
         InputFileInfo prev, curr, next;
      
      Test Plan: pmake on local environment
      
      Reviewers: sdong igor
      
      CC: leveldb@
      
      Task ID: #
      
      Blame Rev:
      c6139606
    • A
      Update --help message in db_bench. · 2c8de0ec
      Aaron Feldman 提交于
      Summary:
      Remove --help entry for readhot.
      
      Update read_random_exp_range flag description: The distribution is num *
      exp(-r), not num * exp(r).
      
      Test Plan: Run ./db_bench --help
      
      Reviewers: sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D42303
      2c8de0ec
    • A
      Refactoring of writing key/value pairs · 6b2d44b2
      Andres Notzli 提交于
      Summary:
      Before, writing key/value pairs out to files was done inside
      ProcessKeyValueCompaction(). To make ProcessKeyValueCompaction()
      more understandable, this patch moves the writing part to a separate
      function. This is intended to be a stepping stone for additional
      changes.
      
      Test Plan: make && make check
      
      Reviewers: sdong, rven, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42243
      6b2d44b2
  4. 15 7月, 2015 16 次提交
  5. 14 7月, 2015 1 次提交
    • I
      Deprecate purge_redundant_kvs_while_flush · a9c51095
      Igor Canadi 提交于
      Summary: This option is guarding the feature implemented 2 and a half years ago: D8991. The feature was enabled by default back then and has been running without issues. There is no reason why any client would turn this feature off. I found no reference in fbcode.
      
      Test Plan: none
      
      Reviewers: sdong, yhchiang, anthony, dhruba
      
      Reviewed By: dhruba
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42063
      a9c51095