1. 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
  2. 31 5月, 2017 2 次提交
  3. 17 5月, 2017 1 次提交
  4. 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
  5. 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
  6. 12 5月, 2017 1 次提交
  7. 11 5月, 2017 1 次提交
  8. 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
  9. 27 4月, 2017 1 次提交
  10. 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
  11. 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
  12. 18 4月, 2017 1 次提交
  13. 17 4月, 2017 1 次提交
  14. 10 4月, 2017 1 次提交
  15. 07 4月, 2017 4 次提交
    • 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
    • T
      CMake: more MinGW fixes · 107c5f6a
      Tamir Duberstein 提交于
      Summary:
      siying this is a resubmission of #2081 with the 4th commit fixed. From that commit message:
      
      > Note that the previous use of quotes in PLATFORM_{CC,CXX}FLAGS was
      incorrect and caused GCC to produce the incorrect define:
      >
      >  #define ROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE 1
      >
      > This was the cause of the Linux build failure on the previous version
      of this change.
      
      I've tested this locally, and the Linux build succeeds now.
      Closes https://github.com/facebook/rocksdb/pull/2097
      
      Differential Revision: D4839964
      
      Pulled By: siying
      
      fbshipit-source-id: cc51322
      107c5f6a
  16. 06 4月, 2017 2 次提交
  17. 05 4月, 2017 3 次提交
  18. 04 4月, 2017 2 次提交
  19. 31 3月, 2017 1 次提交
  20. 30 3月, 2017 1 次提交
  21. 04 3月, 2017 1 次提交
  22. 01 3月, 2017 1 次提交
  23. 28 2月, 2017 1 次提交
  24. 24 2月, 2017 1 次提交
  25. 07 2月, 2017 1 次提交
    • D
      Windows thread · 0a4cdde5
      Dmitri Smirnov 提交于
      Summary:
      introduce new methods into a public threadpool interface,
      - allow submission of std::functions as they allow greater flexibility.
      - add Joining methods to the implementation to join scheduled and submitted jobs with
        an option to cancel jobs that did not start executing.
      - Remove ugly `#ifdefs` between pthread and std implementation, make it uniform.
      - introduce pimpl for a drop in replacement of the implementation
      - Introduce rocksdb::port::Thread typedef which is a replacement for std::thread.  On Posix Thread defaults as before std::thread.
      - Implement WindowsThread that allocates memory in a more controllable manner than windows std::thread with a replaceable implementation.
      - should be no functionality changes.
      Closes https://github.com/facebook/rocksdb/pull/1823
      
      Differential Revision: D4492902
      
      Pulled By: siying
      
      fbshipit-source-id: c74cb11
      0a4cdde5
  26. 03 2月, 2017 1 次提交
  27. 26 1月, 2017 1 次提交
    • A
      Generalize Env registration framework · 17c11806
      Andrew Kryczka 提交于
      Summary:
      The Env registration framework supports registering client Envs and selecting which one to instantiate according to a text field. This enabled things like adding the -env_uri argument to db_bench, so the same binary could be reused with different Envs just by changing CLI config.
      
      Now this problem has come up again in a non-Env context, as I want to instantiate a client Statistics implementation from db_bench, which is configured entirely via text parameters. Also, in the future we may wish to use it for deserializing client objects when loading OPTIONS file.
      
      This diff generalizes the Env registration logic to work with arbitrary types.
      
      - Generalized registration and instantiation code by templating them
      - The entire implementation is in a header file as that's Google style guide's recommendation for template definitions
      - Pattern match with std::regex_match rather than checking prefix, which was the previous behavior
      - Rename functions/files to be non-Env-specific
      Closes https://github.com/facebook/rocksdb/pull/1776
      
      Differential Revision: D4421933
      
      Pulled By: ajkr
      
      fbshipit-source-id: 34647d1
      17c11806
  28. 25 1月, 2017 1 次提交
    • A
      Version librocksdb.so · fba726e5
      Arun Sharma 提交于
      Summary:
      After make install, I see a directory hierarchy that looks like
      
      ```
      ./usr
      ./usr/include
      ./usr/include/rocksdb
      ./usr/include/rocksdb/filter_policy.h
      [..]
      ./usr/include/rocksdb/iterator.h
      ./usr/include/rocksdb/utilities
      ./usr/include/rocksdb/utilities/ldb_cmd_execute_result.h
      ./usr/include/rocksdb/utilities/lua
      ./usr/include/rocksdb/utilities/lua/rocks_lua_custom_library.h
      ./usr/include/rocksdb/utilities/lua/rocks_lua_util.h
      ./usr/include/rocksdb/utilities/lua/rocks_lua_compaction_filter.h
      ./usr/include/rocksdb/utilities/backupable_db.h
      [..]
      ./usr/include/rocksdb/utilities/env_registry.h
      [..]
      ./usr/include/rocksdb/env.h
      ./usr/lib64
      ./usr/lib64/librocksdb.so.5
      ./usr/lib64/librocksdb.so.5.0.0
      ./usr/lib64/librocksdb.so
      ./usr/lib64/librocksdb.a
      ```
      Closes https://github.com/facebook/rocksdb/pull/1798
      
      Differential Revision: D4456536
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 5494e91
      fba726e5
  29. 21 1月, 2017 1 次提交
    • A
      Fixup a couple of builds errors on Linux. · d7ea44f2
      Arun Sharma 提交于
      Summary:
      The libraries produced on linux are now named
      librocksdb.a
      librocksdb.so
      
      Other fixes:
      
      * Also link with -lrt to avoid linker errors.
      * Generalize comments at the top to include Linux
      * Move -lgtest before -lpthread to avoid linker errors
      * move add_subdirectory(tools) to the end so it picks up
        the right libraries
      Closes https://github.com/facebook/rocksdb/pull/1364
      
      Differential Revision: D4444138
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: f0e2c19
      d7ea44f2