1. 27 2月, 2016 1 次提交
  2. 12 2月, 2016 1 次提交
    • A
      Add flag to forcibly disable fallocate · 6a2b4fcb
      Andrew Kryczka 提交于
      Summary:
      see https://github.com/facebook/rocksdb/issues/977; there are issues
      with fallocate() on certain filesystems/kernel versions that can lead it to pre-
      allocating blocks but never freeing them, even if they're unused.
      
      Test Plan:
      verified build commands omit DROCKSDB_FALLOCATE_PRESENT when this env
      variable is set.
      
      without disabling it:
      
        $ ROCKSDB_NO_FBCODE=1 make -n env_test | grep -q DROCKSDB_FALLOCATE_PRESENT ; echo $?
        0
      
      with disabling it:
      
        $ ROCKSDB_NO_FBCODE=1 DISABLE_FALLOCATE=1 make -n env_test | grep -q DROCKSDB_FALLOCATE_PRESENT ; echo $?
        1
      
      Reviewers: kradhakrishnan, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D54069
      6a2b4fcb
  3. 19 1月, 2016 1 次提交
    • B
      Simple changes to support builds for ppc64[le] consistent with X86 · f423f05d
      bcbrock 提交于
      These simple changes are required to allow builds on ppc64[le] systems
      consistent with X86. The Makefile now recognizes both ppc64 and ppc64le, and
      in the absence of PORTABLE=1, the code will be built analogously to the X86
      -march=native.
      
      Note that although GCC supports -mcpu=native -mtune=native on POWER, it
      doesn't work correctly on all systems. This is why we need to get the actual
      machine model from the AUX vector.
      f423f05d
  4. 22 10月, 2015 1 次提交
    • J
      Split posix storage backend into Env and library · 6e6dd5f6
      Javier González 提交于
      Summary: This patch splits the posix storage backend into Env and
      the actual *File implementations. The motivation is to allow other Envs
      to use posix as a library. This enables a storage backend different from
      posix to split its secondary storage between a normal file system
      partition managed by posix, and it own media.
      
      Test Plan: No new functionality is added to posix Env or the library,
      thus the current tests should suffice.
      6e6dd5f6
  5. 10 10月, 2015 1 次提交
  6. 15 9月, 2015 1 次提交
  7. 29 8月, 2015 1 次提交
    • S
      Add ZSTD (not final format) compression type · 7a0dbdf3
      sdong 提交于
      Summary: Add ZSTD compression type. The same way as adding LZ4.
      
      Test Plan: run all tests. Generate files in db_bench. Make sure reads succeed. But the SST files cannot be opened in older versions. Also some other adhoc tests.
      
      Reviewers: rven, anthony, IslamAbdelRahman, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: MarkCallaghan, maykov, yoshinorim, leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D45747
      7a0dbdf3
  8. 27 6月, 2015 1 次提交
    • I
      Use malloc_usable_size() for accounting block cache size · 0a019d74
      Igor Canadi 提交于
      Summary:
      Currently, when we insert something into block cache, we say that the block cache capacity decreased by the size of the block. However, size of the block might be less than the actual memory used by this object. For example, 4.5KB block will actually use 8KB of memory. So even if we configure block cache to 10GB, our actually memory usage of block cache will be 20GB!
      
      This problem showed up a lot in testing and just recently also showed up in MongoRocks production where we were using 30GB more memory than expected.
      
      This diff will fix the problem. Instead of counting the block size, we will count memory used by the block. That way, a block cache configured to be 10GB will actually use only 10GB of memory.
      
      I'm using non-portable function and I couldn't find info on portability on Google. However, it seems to work on Linux, which will cover majority of our use-cases.
      
      Test Plan:
      1. fill up mongo instance with 80GB of data
      2. restart mongo with block cache size configured to 10GB
      3. do a table scan in mongo
      4. memory usage before the diff: 12GB. memory usage after the diff: 10.5GB
      
      Reviewers: sdong, MarkCallaghan, rven, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D40635
      0a019d74
  9. 24 6月, 2015 1 次提交
  10. 13 6月, 2015 1 次提交
    • S
      Cygwin build not to use -fPIC · 46296cc8
      sdong 提交于
      Summary:
      Cygwin doesn't support -fPIC. Remove it.
      Not sure whether we can build shared library in Cygwin but at least it can build without warning.
      
      Test Plan: Build under Cygwin
      
      Reviewers: yhchiang, rven, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D40077
      46296cc8
  11. 24 4月, 2015 2 次提交
    • S
      Build for CYGWIN · 98a44559
      sdong 提交于
      Summary:
      Make it build for CYGWIN.
      Need to define "-std=gnu++11" instead of "-std=c++11" and use some replacement functions.
      
      Test Plan: Build it and run some unit tests in CYGWIN
      
      Reviewers: yhchiang, rven, anthony, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37605
      98a44559
    • I
      Enable open source users to use jemalloc (github issue #438) · fd7a3573
      Igor Canadi 提交于
      Summary: Currently open source rocksdb only builds with tcmalloc. This diff first checks if jemalloc is available. If it is, it compiles with jemalloc. If it isn't, it checks for tcmalloc.
      
      Test Plan: Tried this out on my Ubuntu virtual machine and confirms that jemalloc is correctly detected and compiled.
      
      Reviewers: MarkCallaghan, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: adamretter, meyering, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36789
      fd7a3573
  12. 23 4月, 2015 1 次提交
    • I
      Fix gflags Makefile · 6a5ffee0
      Igor Canadi 提交于
      Summary: `echo` correctly interpretes \n on mac, but not on linux. On linux you have to give it `-e` to interpret \n. Unfortunately, `-e` options is not available on Mac. Go back to old way of checking gflags
      
      Test Plan: build_tools/build_detect_platform on mac and linux
      
      Reviewers: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D37515
      6a5ffee0
  13. 21 4月, 2015 2 次提交
    • I
      Get rid of error output · 7d136994
      Igor Canadi 提交于
      Summary: We should send error output to /dev/null
      
      Test Plan: none
      
      Reviewers: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37449
      7d136994
    • I
      Fix compile with two gflags · 742fa9e3
      Igor Canadi 提交于
      Summary:
      If the system has gflags with both `google` and `gflags` namespaces installed, we try to define GFLAGS as two things. This breaks the compile.
      
      Fix: Use `else if` -- try compiling with `google` namespace only if compile with `gflags` failed
      
      Test Plan: build_tools/build_detect_platform correctly identifies gflags
      
      Reviewers: lgalanis
      
      Reviewed By: lgalanis
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37389
      742fa9e3
  14. 14 4月, 2015 1 次提交
  15. 10 4月, 2015 1 次提交
    • I
      Remove use of whole-archive to include jemalloc · 91df4e96
      Igor Canadi 提交于
      Summary: I don't think we need to use whole-archive to include jemalloc. This change only affects our development builds -- it does not affect our open source builds (which don't support jemalloc) or our fbcode third-party2 builds (which use open-source build codepaths).
      
      Test Plan:
      make
      verify that jemalloc is running by running `MALLOC_CONF="prof:true" ./cache_test` and observing that file was created
      
      Reviewers: MarkCallaghan
      
      Reviewed By: MarkCallaghan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36783
      91df4e96
  16. 08 4月, 2015 1 次提交
    • I
      Fix github issue #563 · c66483c1
      Igor Canadi 提交于
      Summary:
      As described in https://github.com/facebook/rocksdb/issues/563, we should add minor version to SONAME, since we break ABI with minor releases.
      
      I also turned PLATFORM_SHARED_VERSIONED to true by default. This is true in LevelDB and it was switched to false by D15117 for no apparent reason. It should only be false for iOS.
      
      Test Plan: `make shared_lib` produced librocksdb.dylib.3.10.0
      
      Reviewers: sdong, yhchiang, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36573
      c66483c1
  17. 07 3月, 2015 1 次提交
    • J
      build: fix missing dependency problems · ebc647de
      Jim Meyering 提交于
      Summary:
      Any time one would modify a dependent of any *test*.cc file,
      "make" would fail to rebuild the affected test binaries,
      e.g., db_test.  That was due to the fact that we deliberately
      excluded those test-related files from the definition of SOURCES
      and only $(SOURCES) was used to create the automatically-generated
      .d dependency files.  The fix is to generate a .d file for every
      source file.
      * src.mk: New file.  Defines LIB_SOURCES, MOCK_SOURCES
      and TEST_BENCH_SOURCES.
      * Makefile: Include src.mk.
      Reflect s/SOURCES/LIB_SOURCES/ renaming.
      * build_tools/build_detect_platform: Remove the code
      that was used to generate SOURCES= and MOCK_SOURCES=
      definitions in make_config.mk. Those lists of files
      are now hard-coded in src.mk. Hard-coding this list of
      sources is desirable, because without that, one risks
      including stray .cc files in a build.  Not reproducible.
      
      Test Plan:
      Touch a file used by db_test's dependent .o files and ensure that
      they are all recompiled.  Before, none would be:
      
        $ touch db/db_impl.h && make db_test
          CC       db/db_test.o
          CC       db/column_family.o
          CC       db/db_filesnapshot.o
          CC       db/db_impl.o
          CC       db/db_impl_debug.o
          CC       db/db_impl_readonly.o
          CC       db/forward_iterator.o
          CC       db/internal_stats.o
          CC       db/managed_iterator.o
          CC       db/repair.o
          CC       db/write_batch.o
          CC       utilities/compacted_db/compacted_db_impl.o
          CC       utilities/ttl/db_ttl_impl.o
          CC       util/ldb_cmd.o
          CC       util/ldb_tool.o
          CC       util/sst_dump_tool.o
          CC       util/xfunc.o
          CCLD     db_test
      
      Reviewers: ljin, igor.sugak, igor, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: yhchiang, adamretter, fyrz, dhruba
      
      Differential Revision: https://reviews.facebook.net/D33849
      ebc647de
  18. 28 2月, 2015 1 次提交
  19. 27 2月, 2015 1 次提交
  20. 20 2月, 2015 1 次提交
    • 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
  21. 04 2月, 2015 1 次提交
    • I
      rocksdb: Enable scan-build static analysis · 4d98e293
      Igor Sugak 提交于
      Summary:
      Added new target ##make analyze## into Makefile. This command runs clang static analyzer and builds the sources as ##make all##. The result report is put into ##$(RocksDbSourceRoot)/can_build_report/##
      
      If the development environment is a Facebook devserver and ##ROCKSDB_NO_FBCODE## is not set, then scan-build is used from fbcode. If it is run not on a Facebook devserver, scan-build should be available in ##$PATH##. I'll add details to wiki how to install scan-build on a non Facebook devserver environment.
      
      Test Plan:
      Run the fallowing commands on a Facebook devserver and Mac OS, and ensure no build or test errors.
      
      ```
      % make all check -j32
      % make clean
      % USE_CLANG=1 make all -j32
      % make analyze
      % USE_CLANG=1 make analyze
      ```
      
      Reviewers: sdong, lgalanis, leveldb, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D32799
      4d98e293
  22. 30 1月, 2015 1 次提交
  23. 28 1月, 2015 1 次提交
  24. 24 1月, 2015 2 次提交
    • I
      Return the build with 4.8.1 · 910186c2
      Igor Canadi 提交于
      Summary: We need this because we build MySQL with 4.8.1.
      
      Test Plan: ROCKSDB_FBCODE_BUILD_WITH_481=1 make check
      
      Reviewers: sdong, yhchiang, rven, yoshinorim
      
      Reviewed By: yoshinorim
      
      Subscribers: jonahcohen, yoshinorim, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D32073
      910186c2
    • I
      Add thread sanitizer · 401d4205
      Igor Canadi 提交于
      Summary: When you compile with COMPILE_WITH_TSAN=1, we will compile the code with -fsanitize=thread. This will resolve bunch of data race issues we might have.
      
      Test Plan: COMPILE_WITH_TSAN=1 m db_test
      
      Reviewers: yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D32019
      401d4205
  25. 16 1月, 2015 1 次提交
  26. 20 12月, 2014 1 次提交
  27. 15 12月, 2014 1 次提交
    • I
      Optimize default compile to compilation platform by default · 06eed650
      Igor Canadi 提交于
      Summary:
      This diff changes compile to optimize for native platform by default. This will automatically turn on crc32 optimizations for modern processors, which greatly improves rocksdb's performance.
      
      I also did some more changes to compilation documentation.
      
      Test Plan:
      compile with `make`, observe -march=native
      compile with `PORTABLE=1 make`, observe no -march=native
      
      Reviewers: sdong, rven, yhchiang, MarkCallaghan
      
      Reviewed By: MarkCallaghan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D30225
      06eed650
  28. 12 11月, 2014 1 次提交
    • I
      Turn on -Wshorten-64-to-32 and fix all the errors · 767777c2
      Igor Canadi 提交于
      Summary:
      We need to turn on -Wshorten-64-to-32 for mobile. See D1671432 (internal phabricator) for details.
      
      This diff turns on the warning flag and fixes all the errors. There were also some interesting errors that I might call bugs, especially in plain table. Going forward, I think it makes sense to have this flag turned on and be very very careful when converting 64-bit to 32-bit variables.
      
      Test Plan: compiles
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: yhchiang
      
      Subscribers: bobbaldwin, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28689
      767777c2
  29. 04 11月, 2014 1 次提交
    • I
      Revamp our build tools · 30ca3752
      Igor Canadi 提交于
      Summary:
      This diff is revamping our build tools:
      1) Use third-party2 instead of third-party
      2) consolidate clang and gcc scripts together, lots of duplication there
      3) remove hdfs libs, we never compile rocksdb with them
      
      clang compilation doesn't work yet. It doesn't work in master either. I plan to fix it soon, but I just spent 2 hours trying to make it work and failed. I'll ask experts.
      
      Test Plan: compiles with gcc
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28047
      30ca3752
  30. 01 11月, 2014 1 次提交
  31. 29 10月, 2014 2 次提交
    • I
      Include all the mocks · c0828533
      Igor Canadi 提交于
      c0828533
    • I
      TableMock + framework for mock classes · abac3d64
      Igor Canadi 提交于
      Summary:
      This diff replaces BlockBasedTable in flush_job_test with TableMock, making it depend on less things and making it closer to an unit test than integration test.
      
      It also introduces a framework to compile mock classes -- Any file named *mock.cc will not be compiled into the build. It will only get compiled into the tests. What way we can mock out most other classes, Version, VersionSet, DBImpl, etc.
      
      Test Plan: flush_job_test
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D27681
      abac3d64
  32. 28 10月, 2014 1 次提交
    • I
      Deprecate AtomicPointer · 48842ab3
      Igor Canadi 提交于
      Summary: RocksDB already depends on C++11, so we might as well all the goodness that C++11 provides. This means that we don't need AtomicPointer anymore. The less things in port/, the easier it will be to port to other platforms.
      
      Test Plan: make check + careful visual review verifying that NoBarried got memory_order_relaxed, while Acquire/Release methods got memory_order_acquire and memory_order_release
      
      Reviewers: rven, yhchiang, ljin, sdong
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D27543
      48842ab3
  33. 03 10月, 2014 1 次提交
    • I
      Don't keep managing two rocksdb version · 0908ddce
      Igor Canadi 提交于
      Summary:
      Before this diff, there are two places with rocksdb versions. After the diff:
      1. we only have one source of truth for rocksdb version
      2. we have a script that we can use to get the version that we can use in other compilations (java, go, etc).
      
      Test Plan: make
      
      Reviewers: yhchiang, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D24333
      0908ddce
  34. 20 9月, 2014 1 次提交
    • I
      Enable no-fbcode RocksDB build · 3b897cdd
      Igor Canadi 提交于
      Summary: I want to use open source build rather than fbcode one. This enables me to run `ROCKSDB_NO_FBCODE=1 make` and run it with my system g++.
      
      Test Plan:
      ROCKSDB_NO_FBCODE=1 make
      make
      
      Reviewers: sdong, ljin, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D23613
      3b897cdd
  35. 22 7月, 2014 1 次提交
    • Y
      Fixed some make and linking issues of RocksDBJava · ae7743f2
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed some make and linking issues of RocksDBJava. Specifically:
      * Add JAVA_LDFLAGS, which does not include gflags
      * rocksdbjava library now uses JAVA_LDFLAGS instead of LDFLAGS
      * java/Makefile now includes build_config.mk
      * rearrange make rocksdbjava workflow to ensure the library file is correctly
        included in the jar file.
      
      Test Plan:
      make rocksdbjava
      make jdb_bench
      java/jdb_bench.sh
      
      Reviewers: dhruba, swapnilghike, zzbennett, rsumbaly, ankgup87
      
      Reviewed By: ankgup87
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20289
      ae7743f2
  36. 08 7月, 2014 1 次提交
    • R
      Adding NUMA support to db_bench tests · f0660d52
      Radheshyam Balasundaram 提交于
      Summary:
      Changes:
      - Adding numa_aware flag to db_bench.cc
      - Using numa.h library to bind memory and cpu of threads to a fixed NUMA node
      Result: There seems to be no significant change in the micros/op time with numa_aware enabled. I also tried this with other implementations, including a combination of pthread_setaffinity_np, sched_setaffinity and set_mempolicy methods. It'd be great if someone could point out where I'm going wrong and if we can achieve a better micors/op.
      
      Test Plan:
      Ran db_bench tests using following command:
      ./db_bench --db=/mnt/tmp --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --block_size=4096 --cache_size=17179869184 --cache_numshardbits=6 --compression_type=none --compression_ratio=1 --min_level_to_compress=-1 --disable_seek_compaction=1 --hard_rate_limit=2 --write_buffer_size=134217728 --max_write_buffer_number=2 --level0_file_num_compaction_trigger=8 --target_file_size_base=134217728 --max_bytes_for_level_base=1073741824 --disable_wal=0 --wal_dir=/mnt/tmp --sync=0 --disable_data_sync=1 --verify_checksum=1 --delete_obsolete_files_period_micros=314572800 --max_grandparent_overlap_factor=10 --max_background_compactions=4 --max_background_flushes=0 --level0_slowdown_writes_trigger=16 --level0_stop_writes_trigger=24 --statistics=0 --stats_per_interval=0 --stats_interval=1048576 --histogram=0 --use_plain_table=1 --open_files=-1 --mmap_read=1 --mmap_write=0 --memtablerep=prefix_hash --bloom_bits=10 --bloom_locality=1 --perf_level=0 --duration=300 --benchmarks=readwhilewriting --use_existing_db=1 --num=157286400 --threads=24 --writes_per_second=10240 --numa_aware=[False/True]
      
      The tests were run in private devserver with 24 cores and the db was prepopulated using filluniquerandom test. The tests resulted in 0.145 us/op with numa_aware=False and 0.161 us/op with numa_aware=True.
      
      Reviewers: sdong, yhchiang, ljin, igor
      
      Reviewed By: ljin, igor
      
      Subscribers: igor, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19353
      f0660d52