port_posix: use posix_memalign() for aligned_alloc
Summary:
to workaround issue of http://tracker.ceph.com/issues/21422 .
and in tcmalloc aligned_alloc and posix_memalign() are basically the
same thing. the same applies to GNU glibc.
fixes #3175
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Closes https://github.com/facebook/rocksdb/pull/3862
Differential Revision:
D8147930
Pulled By: yiwu-arbug
fbshipit-source-id:
355afe93c4dd0a96a0d711ef190e8b86fbe8d11d
refactor constructor of LRUCacheShard
Summary:
Update LRUCacheShard constructor so that adding new params to it don't need to add extra SetXXX() methods.
Closes https://github.com/facebook/rocksdb/pull/3896
Differential Revision:
D8128618
Pulled By: yiwu-arbug
fbshipit-source-id:
6afa715de1493a50de413678761a765e3af9b83b
Introduce library-independent default compression level
Summary:
Previously we were using -1 as the default for every library, which was legacy from our zlib options. That worked for a while, but after zstd introduced https://github.com/facebook/zstd/commit/
a146ee04ae5866b948be0c1911418e0436d80cb4, it started giving poor compression ratios by default in zstd.
This PR adds a constant to RocksDB public API, `CompressionOptions::kDefaultCompressionLevel`, which will get translated to the default value specific to the compression library being used in "util/compression.h". The constant uses a number that appears to be larger than any library's maximum compression level.
Closes https://github.com/facebook/rocksdb/pull/3895
Differential Revision:
D8125780
Pulled By: ajkr
fbshipit-source-id:
2db157a89118cd4f94577c2f4a0a5ff31c8391c6
Specify the underlying type of enums.
Summary:
Explicitly specify the underlying type of enums help developers understand the physical storage.
Closes https://github.com/facebook/rocksdb/pull/3892
Differential Revision:
D8107027
Pulled By: riversand963
fbshipit-source-id:
a00efecbba46df4a3c8eed0994a2d4972ad1a1d3
Fix a backward compatibility problem with table_properties being nullptr
Summary:
Currently when ldb built from master tries to open a DB from version 2.2, there will be a segfault because table_properties didn't exist back then.
Closes https://github.com/facebook/rocksdb/pull/3890
Differential Revision:
D8100914
Pulled By: miasantreble
fbshipit-source-id:
b255e8aedc54695432be2e704839c857dabdd65a
Fix Issue #3771: Slice ctor checks for nullptr and creates empty string
Summary:
Fix Issue #3771 : Check for nullptr in Slice constructor
Slice ctor checks for nullptr and creates empty string if the string does not exist
Closes https://github.com/facebook/rocksdb/pull/3887
Differential Revision:
D8098852
Pulled By: ajkr
fbshipit-source-id:
04471077defa9776ce7b8c389a61312ce31002fb
Avoid sleep in DBTest.GroupCommitTest to fix flakiness
Summary:
DBTest.GroupCommitTest would often fail when run under valgrind because its sleeps were insufficient to guarantee a group commit had multiple entries. Instead we can use sync point to force a leader to wait until a non-leader thread has enqueued its work, thus guaranteeing a leader can do group commit work for multiple threads.
Closes https://github.com/facebook/rocksdb/pull/3883
Differential Revision:
D8079429
Pulled By: ajkr
fbshipit-source-id:
61dc50fad29d2c85547842f681288de60fa29049
Avoid single-deleting merge operands in db_stress
Summary:
I repro'd some of the "unexpected value" failures showing up in our CI lately and they always happened on keys that have a mix of single deletes and merge operands. The `SingleDelete()` API comment mentions it's incompatible with `Merge()`, so this PR prevents `db_stress` from mixing them.
Closes https://github.com/facebook/rocksdb/pull/3878
Differential Revision:
D8097346
Pulled By: ajkr
fbshipit-source-id:
357a48c6a31156f4f8db3ce565638ad924c437a1