1. 29 8月, 2017 2 次提交
  2. 22 8月, 2017 1 次提交
  3. 14 8月, 2017 2 次提交
    • N
      properly set C[XX]FLAGS during CMake configure-time checks · 279296f4
      Nikhil Benesch 提交于
      Summary:
      Some compilers require `-std=c++11` for the `cstdint` header to be available. We already have logic to add `-std=c++11` to `CXXFLAGS` when the compiler is not MSVC; simply reorder CMakeLists.txt so that logic happens before the calls to `CHECK_CXX_SOURCE_COMPILES`.
      
      Additionally add a missing `set(CMAKE_REQUIRED_FLAGS, ...)` before a call to `CHECK_C_SOURCE_COMPILES`.
      Closes https://github.com/facebook/rocksdb/pull/2535
      
      Differential Revision: D5384244
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 2dbae4297c5d8ab4636e08b1457ffb2d3e37aef4
      279296f4
    • J
      cmake: support more compression type · 185ade4c
      Jay 提交于
      Summary:
      This pr enables linking all the supported compression libraries via cmake.
      Closes https://github.com/facebook/rocksdb/pull/2552
      
      Differential Revision: D5620607
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: b6949181f305bfdf04a98f898c92fd0caba0c45a
      185ade4c
  4. 08 8月, 2017 1 次提交
    • M
      Refactor PessimisticTransaction · bdc056f8
      Maysam Yabandeh 提交于
      Summary:
      This patch splits Commit and Prepare into lock-related logic and db-write-related logic. It moves lock-related logic to PessimisticTransaction to be reused by all children classes and movies the existing impl of db-write-related to PrepareInternal, CommitSingleInternal, and CommitInternal in WriteCommittedTxnImpl.
      Closes https://github.com/facebook/rocksdb/pull/2691
      
      Differential Revision: D5569464
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: d1b8698e69801a4126c7bc211745d05c636f5325
      bdc056f8
  5. 06 8月, 2017 1 次提交
  6. 03 8月, 2017 1 次提交
    • M
      Refactor TransactionImpl · c3d5c4d3
      Maysam Yabandeh 提交于
      Summary:
      This patch refactors TransactionImpl by separating the logic for pessimistic concurrency control from the implementation of how to write the data to rocksdb. The existing implementation is named WriteCommittedTxnImpl as it writes committed data to the db. A template named WritePreparedTxnImpl is also added which will be later completed to provide a an alternative implementation.
      Closes https://github.com/facebook/rocksdb/pull/2676
      
      Differential Revision: D5549998
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 16298e86b43ca4849324c1f35c731913c6d17bec
      c3d5c4d3
  7. 02 8月, 2017 1 次提交
    • Y
      Dump Blob DB options to info log · 1900771b
      Yi Wu 提交于
      Summary:
      * Dump blob db options to info log
      * Remove BlobDBOptionsImpl to disallow dynamic cast *BlobDBOptions into *BlobDBOptionsImpl. Move options there to be constants or into BlobDBOptions. The dynamic cast is broken after #2645
      * Change some of the default options
      * Remove blob_db_options.min_blob_size, which is unimplemented. Will implement it soon.
      Closes https://github.com/facebook/rocksdb/pull/2671
      
      Differential Revision: D5529912
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: dcd58ca981db5bcc7f123b65a0d6f6ae0dc703c7
      1900771b
  8. 29 7月, 2017 1 次提交
    • I
      CacheActivityLogger, component to log cache activity into a file · 50a96913
      Islam AbdelRahman 提交于
      Summary:
      Simple component that will add a new entry in a log file every time we lookup/insert a key in SimCache.
      API:
      ```
      SimCache::StartActivityLogging(<file_name>, <env>, <optional_max_size>)
      SimCache::StopActivityLogging()
      ```
      
      Sending for review, Still need to add more comments.
      
      I was thinking about a better approach, but I ended up deciding I will use a mutex to sync the writes to the file, since this feature should not be heavily used and only used to collect info that will be analyzed offline. I think it's okay to hold the mutex every time we lookup/add to the SimCache.
      Closes https://github.com/facebook/rocksdb/pull/2295
      
      Differential Revision: D5063826
      
      Pulled By: IslamAbdelRahman
      
      fbshipit-source-id: f3b5daed8b201987c9a071146ddd5c5740a2dd8c
      50a96913
  9. 28 7月, 2017 1 次提交
    • Y
      Blob DB TTL extractor · 6083bc79
      Yi Wu 提交于
      Summary:
      Introducing blob_db::TTLExtractor to replace extract_ttl_fn. The TTL
      extractor can be use to extract TTL from keys insert with Put or
      WriteBatch. Change over existing extract_ttl_fn are:
      * If value is changed, it will be return via std::string* (rather than Slice*). With Slice* the new value has to be part of the existing value. With std::string* the limitation is removed.
      * It can optionally return TTL or expiration.
      
      Other changes in this PR:
      * replace `std::chrono::system_clock` with `Env::NowMicros` so that I can mock time in tests.
      * add several TTL tests.
      * other minor naming change.
      Closes https://github.com/facebook/rocksdb/pull/2659
      
      Differential Revision: D5512627
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 0dfcb00d74d060b8534c6130c808e4d5d0a54440
      6083bc79
  10. 22 7月, 2017 1 次提交
    • P
      Cassandra compaction filter for purge expired columns and rows · 534c255c
      Pengchao Wang 提交于
      Summary:
      Major changes in this PR:
      * Implement CassandraCompactionFilter to remove expired columns and rows (if all column expired)
      * Move cassandra related code from utilities/merge_operators/cassandra to utilities/cassandra/*
      * Switch to use shared_ptr<> from uniqu_ptr for Column membership management in RowValue. Since columns do have multiple owners in Merge and GC process, use shared_ptr helps make RowValue immutable.
      * Rename cassandra_merge_test to cassandra_functional_test and add two TTL compaction related tests there.
      Closes https://github.com/facebook/rocksdb/pull/2588
      
      Differential Revision: D5430010
      
      Pulled By: wpc
      
      fbshipit-source-id: 9566c21e06de17491d486a68c70f52d501f27687
      534c255c
  11. 18 7月, 2017 1 次提交
    • A
      Revert cmake -DNDEBUG for non-MSVC · 7ac184c6
      Andrew Kryczka 提交于
      Summary:
      Unfortunately we can't use -DNDEBUG yet since we don't properly exclude the test libraries/executables from the non-debug builds on non-MSVC platforms. Previously this was failing on Linux for every build type except `CMAKE_BUILD_TYPE=Debug`.
      
      Reverts a48a62d5
      Closes https://github.com/facebook/rocksdb/pull/2595
      
      Differential Revision: D5436182
      
      Pulled By: ajkr
      
      fbshipit-source-id: 062f07cc9ce06a073b66054722b27bac1890dca3
      7ac184c6
  12. 11 7月, 2017 1 次提交
    • G
      Fix undefined behavior in Hash · 8f927e5f
      Giuseppe Ottaviano 提交于
      Summary:
      Instead of ignoring UBSan checks, fix the negative shifts in
      Hash(). Also add test to make sure the hash values are stable over
      time. The values were computed before this change, so the test also
      verifies the correctness of the change.
      Closes https://github.com/facebook/rocksdb/pull/2546
      
      Differential Revision: D5386369
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 6de4b44461a544d6222cc5d72d8cda2c0373d17e
      8f927e5f
  13. 28 6月, 2017 1 次提交
    • Y
      Fix TARGETS file tests list · 982cec22
      Yi Wu 提交于
      Summary:
      1. The buckifier script assume each test "foo" comes with a .cc file of the same name (i.e. foo.cc). Update cassandra tests to follow this pattern so that the buckifier script can recognize them.
      2. add blob_db_test
      Closes https://github.com/facebook/rocksdb/pull/2506
      
      Differential Revision: D5331517
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 86f3eba471fc621186ab44cbd073b6162cde8e57
      982cec22
  14. 27 6月, 2017 1 次提交
    • E
      Encryption at rest support · 51778612
      Ewout Prangsma 提交于
      Summary:
      This PR adds support for encrypting data stored by RocksDB when written to disk.
      
      It adds an `EncryptedEnv` override of the `Env` class with matching overrides for sequential&random access files.
      The encryption itself is done through a configurable `EncryptionProvider`. This class creates is asked to create `BlockAccessCipherStream` for a file. This is where the actual encryption/decryption is being done.
      Currently there is a Counter mode implementation of `BlockAccessCipherStream` with a `ROT13` block cipher (NOTE the `ROT13` is for demo purposes only!!).
      
      The Counter operation mode uses an initial counter & random initialization vector (IV).
      Both are created randomly for each file and stored in a 4K (default size) block that is prefixed to that file. The `EncryptedEnv` implementation is such that clients of the `Env` class do not see this prefix (nor data, nor in filesize).
      The largest part of the prefix block is also encrypted, and there is room left for implementation specific settings/values/keys in there.
      
      To test the encryption, the `DBTestBase` class has been extended to consider a new environment variable called `ENCRYPTED_ENV`. If set, the test will setup a encrypted instance of the `Env` class to use for all tests.
      Typically you would run it like this:
      
      ```
      ENCRYPTED_ENV=1 make check_some
      ```
      
      There is also an added test that checks that some data inserted into the database is or is not "visible" on disk. With `ENCRYPTED_ENV` active it must not find plain text strings, with `ENCRYPTED_ENV` unset, it must find the plain text strings.
      Closes https://github.com/facebook/rocksdb/pull/2424
      
      Differential Revision: D5322178
      
      Pulled By: sdwilsh
      
      fbshipit-source-id: 253b0a9c2c498cc98f580df7f2623cbf7678a27f
      51778612
  15. 17 6月, 2017 1 次提交
  16. 03 6月, 2017 1 次提交
    • S
      Improve write buffer manager (and allow the size to be tracked in block cache) · 95b0e89b
      Siying Dong 提交于
      Summary:
      Improve write buffer manager in several ways:
      1. Size is tracked when arena block is allocated, rather than every allocation, so that it can better track actual memory usage and the tracking overhead is slightly lower.
      2. We start to trigger memtable flush when 7/8 of the memory cap hits, instead of 100%, and make 100% much harder to hit.
      3. Allow a cache object to be passed into buffer manager and the size allocated by memtable can be costed there. This can help users have one single memory cap across block cache and memtable.
      Closes https://github.com/facebook/rocksdb/pull/2350
      
      Differential Revision: D5110648
      
      Pulled By: siying
      
      fbshipit-source-id: b4238113094bf22574001e446b5d88523ba00017
      95b0e89b
  17. 02 6月, 2017 1 次提交
    • M
      Retire memenv https://github.com/facebook/rocksdb/pull/2082 · 5a9b4d74
      Maysam Yabandeh 提交于
      Summary:
      This is a manual commit of this PR:
      Retire InMemoryEnv in favor of MockEnv #2082
      With MockEnv doing the same yet being more mature, InMemoryEnv is redundant.
      
      Reviewed By: IslamAbdelRahman
      
      Differential Revision: D5162323
      
      fbshipit-source-id: 59fd0082a891dc99cc531e4da9d68bf891eae3f5
      5a9b4d74
  18. 01 6月, 2017 2 次提交
    • T
      db: avoid `#include`ing malloc and jemalloc simultaneously · 0dc3040d
      Tamir Duberstein 提交于
      Summary:
      This fixes a compilation failure on Linux when the system libc is not
      glibc. jemalloc's configure script incorrectly assumes that glibc is
      always used on Linux systems, producing glibc-style signatures; when
      the system libc is e.g. musl, the following error is observed:
      
      ```
        [  0%] Building CXX object CMakeFiles/rocksdb.dir/db/db_impl.cc.o
        In file included from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/table/block.h:19:0,
                         from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/db/db_impl.cc:77:
        /x-tools/x86_64-unknown-linux-musl/x86_64-unknown-linux-musl/sysroot/usr/include/malloc.h:19:8: error: declaration of 'size_t malloc_usable_size(void*)' has a different exception specifier
         size_t malloc_usable_size(void *);
                ^~~~~~~~~~~~~~~~~~
        In file included from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/db/db_impl.cc:20:0:
        /go/native/x86_64-unknown-linux-musl/jemalloc/include/jemalloc/jemalloc.h:78:33: note: from previous declaration 'size_t malloc_usable_size(void*) throw ()'
         #  define je_malloc_usable_size malloc_usable_size
                                         ^
        /go/native/x86_64-unknown-linux-musl/jemalloc/include/jemalloc/jemalloc.h:239:41: note: in expansion of macro 'je_malloc_usable_size'
         JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size(
                                                 ^~~~~~~~~~~~~~~~~~~~~
        CMakeFiles/rocksdb.dir/build.make:350: recipe for target 'CMakeFiles/rocksdb.dir/db/db_impl.cc.o' failed
      ```
      
      This works around the issue by rearranging the sources such that
      jemalloc's headers are never in the same scope as the system's malloc
      header. The jemalloc issue has been reported as well, see:
      https://github.com/jemalloc/jemalloc/issues/778.
      
      cc tschottdorf
      Closes https://github.com/facebook/rocksdb/pull/2188
      
      Differential Revision: D5163048
      
      Pulled By: siying
      
      fbshipit-source-id: c553125458892def175c1be5682b0330d80b2a0d
      0dc3040d
    • Y
      Fixing blob db sequence number handling · ad19eb86
      Yi Wu 提交于
      Summary:
      Blob db rely on base db returning sequence number through write batch after DB::Write(). However after recent changes to the write path, DB::Writ()e no longer return sequence number in some cases. Fixing it by have WriteBatchInternal::InsertInto() always encode sequence number into write batch.
      
      Stacking on #2375.
      Closes https://github.com/facebook/rocksdb/pull/2385
      
      Differential Revision: D5148358
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 8bda0aa07b9334ed03ed381548b39d167dc20c33
      ad19eb86
  19. 31 5月, 2017 2 次提交
  20. 17 5月, 2017 1 次提交
  21. 16 5月, 2017 2 次提交
    • N
      cross-platform compatibility improvements · 11c5d474
      Nikhil Benesch 提交于
      Summary:
      We've had a couple CockroachDB users fail to build RocksDB on exotic platforms, so I figured I'd try my hand at solving these issues upstream. The problems stem from a) `USE_SSE=1` being too aggressive about turning on SSE4.2, even on toolchains that don't support SSE4.2 and b) RocksDB attempting to detect support for thread-local storage based on OS, even though it can vary by compiler on the same OS.
      
      See the individual commit messages for details. Regarding SSE support, this PR should change virtually nothing for non-CMake based builds. `make`, `PORTABLE=1 make`, `USE_SSE=1 make`, and `PORTABLE=1 USE_SSE=1 make` function exactly as before, except that SSE support will be automatically disabled when a simple SSE4.2-using test program fails to compile, as it does on OpenBSD. (OpenBSD's ports GCC supports SSE4.2, but its binutils do not, so `__SSE_4_2__` is defined but an SSE4.2-using program will fail to assemble.) A warning is emitted in this case. The CMake build is modified to support the same set of options, except that `USE_SSE` is spelled `FORCE_SSE42` because `USE_SSE` is rather useless now that we can automatically detect SSE support, and I figure changing options in the CMake build is less disruptive than changing the non-CMake build.
      
      I've tested these changes on all the platforms I can get my hands on (macOS, Windows MSVC, Windows MinGW, and OpenBSD) and it all works splendidly. Let me know if there's anything you object to—I obviously don't mean to break any of your build pipelines in the process of fixing ours downstream.
      Closes https://github.com/facebook/rocksdb/pull/2199
      
      Differential Revision: D5054042
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 938e1fc665c049c02ae15698e1409155b8e72171
      11c5d474
    • Y
      Fix build error with blob DB. · 86d54925
      Yi Wu 提交于
      Summary:
      snprintf is in <stdio.h> and not in namespace std.
      Closes https://github.com/facebook/rocksdb/pull/2287
      
      Reviewed By: anirbanr-fb
      
      Differential Revision: D5054752
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 356807ec38f3c7d95951cdb41f31a3d3ae0714d4
      86d54925
  22. 13 5月, 2017 1 次提交
    • A
      Add GetAllKeyVersions API · 3fa9a39c
      Andrew Kryczka 提交于
      Summary:
      - Introduced an include/ file dedicated to db-related debug functions to avoid making db.h more complex
      - Added debugging function, `GetAllKeyVersions()`, to return a listing of internal data for a range of user keys. The new `struct KeyVersion` exposes data similar to internal key without exposing any internal type.
      - Migrated the "ldb idump" subcommand to use this function
      - The API takes an inclusive-exclusive range to match behavior of "ldb idump". This will be quite annoying for users who want to query a single user key's versions :(.
      Closes https://github.com/facebook/rocksdb/pull/2232
      
      Differential Revision: D4976007
      
      Pulled By: ajkr
      
      fbshipit-source-id: cab375da53a7595d6575af2b7e3b776aa3ad793e
      3fa9a39c
  23. 12 5月, 2017 1 次提交
  24. 11 5月, 2017 1 次提交
  25. 06 5月, 2017 1 次提交
    • T
      travis: add Windows cross-compilation · fdaefa03
      Tamir Duberstein 提交于
      Summary:
      - downcase includes for case-sensitive filesystems
      - give targets the same name (librocksdb) on all platforms
      
      With this patch it is possible to cross-compile RocksDB for Windows
      from a Linux host using mingw.
      
      cc yuslepukhin orgads
      Closes https://github.com/facebook/rocksdb/pull/2107
      
      Differential Revision: D4849784
      
      Pulled By: siying
      
      fbshipit-source-id: ad26ed6b4d393851aa6551e6aa4201faba82ef60
      fdaefa03
  26. 27 4月, 2017 1 次提交
  27. 25 4月, 2017 1 次提交
    • A
      Reunite checkpoint and backup core logic · e5e545a0
      Andrew Kryczka 提交于
      Summary:
      These code paths forked when checkpoint was introduced by copy/pasting the core backup logic. Over time they diverged and bug fixes were sometimes applied to one but not the other (like fix to include all relevant WALs for 2PC), or it required extra effort to fix both (like fix to forge CURRENT file). This diff reunites the code paths by extracting the core logic into a function, CreateCustomCheckpoint(), that is customizable via callbacks to implement both checkpoint and backup.
      
      Related changes:
      
      - flush_before_backup is now forcibly enabled when 2PC is enabled
      - Extracted CheckpointImpl class definition into a header file. This is so the function, CreateCustomCheckpoint(), can be called by internal rocksdb code but not exposed to users.
      - Implemented more functions in DummyDB/DummyLogFile (in backupable_db_test.cc) that are used by CreateCustomCheckpoint().
      Closes https://github.com/facebook/rocksdb/pull/1932
      
      Differential Revision: D4622986
      
      Pulled By: ajkr
      
      fbshipit-source-id: 157723884236ee3999a682673b64f7457a7a0d87
      e5e545a0
  28. 22 4月, 2017 2 次提交
    • T
      AIX and Solaris Sparc Support · 04d58970
      Tomas Kolda 提交于
      Summary:
      Replacement of #2147
      
      The change was squashed due to a lot of conflicts.
      Closes https://github.com/facebook/rocksdb/pull/2194
      
      Differential Revision: D4929799
      
      Pulled By: siying
      
      fbshipit-source-id: 5cd49c254737a1d5ac13f3c035f128e86524c581
      04d58970
    • N
      Adding -noprofile to CMakeLists for Windows · 066cfbac
      Nick Anderson 提交于
      Summary:
      In the off chance you have a `Microsoft.PowerShell_profile.ps1` profile the `execute_process` will load one's profile during running `cmake`, which will cause garbage output to be written to the `build_version.cc` file. If you add in a `-noprofile` flag, or you suppress output in your pshell profile, this is mitigated.
      Closes https://github.com/facebook/rocksdb/pull/2168
      
      Differential Revision: D4927003
      
      Pulled By: siying
      
      fbshipit-source-id: 83861752d6cf2627dd864eedd2acaa8aa8a6232e
      066cfbac
  29. 18 4月, 2017 1 次提交
  30. 17 4月, 2017 1 次提交
  31. 10 4月, 2017 1 次提交
  32. 07 4月, 2017 3 次提交
    • S
      Refactor compaction picker code · ff972870
      Siying Dong 提交于
      Summary:
      1. Move universal compaction picker to separate files compaction_picker_universal.cc and compaction_picker_universal.h.
      2. Rename some functions to make the code easier to understand.
      3. Move leveled compaction picking code to a dedicated class, so that we we don't need to pass some common variable around when calling functions. It also allowed us to break down LevelCompactionPicker::PickCompaction() to smaller functions.
      Closes https://github.com/facebook/rocksdb/pull/2100
      
      Differential Revision: D4845948
      
      Pulled By: siying
      
      fbshipit-source-id: efa0ab4
      ff972870
    • S
      Move various string utility functions into string_util · 343b59d6
      Sagar Vemuri 提交于
      Summary:
      This is an effort to club all string related utility functions into one common place, in string_util, so that it is easier for everyone to know what string processing functions are available. Right now they seem to be spread out across multiple modules, like logging and options_helper.
      
      Check the sub-commits for easier reviewing.
      Closes https://github.com/facebook/rocksdb/pull/2094
      
      Differential Revision: D4837730
      
      Pulled By: sagar0
      
      fbshipit-source-id: 344278a
      343b59d6
    • Y
      Move memtable related files into memtable directory · df6f5a37
      Yi Wu 提交于
      Summary:
      Move memtable related files into memtable directory.
      Closes https://github.com/facebook/rocksdb/pull/2087
      
      Differential Revision: D4829242
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: ca70ab6
      df6f5a37