]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/log
rocksdb.git
7 years agocompression: instrumentate XXX_Supported() to verify algorithms' statuses.
Radoslaw Zarzynski [Wed, 5 Dec 2018 07:56:14 +0000 (08:56 +0100)]
compression: instrumentate XXX_Supported() to verify algorithms' statuses.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
7 years agoFix the selection of the fast CRC32 path in Ceph Luminous. ceph-luminous
Radoslaw Zarzynski [Thu, 8 Mar 2018 13:40:17 +0000 (14:40 +0100)]
Fix the selection of the fast CRC32 path in Ceph Luminous.

This ugly patch selectively adds the `-msse4.2` for compiling
`util/crc32c.cc` file when a building machine's toolchain had
successfully compiled a simple test program. The CXXFLAGS are
enriched even when `WITH_SSE42` is not set as, in Ceph, there
is no possibility to use the global switch because of lack of
proper run-time SSE4.2 check in other places IIUC.

Although the problem is fixed in `master` of RocksDB, the fix
cannot be backported because the CRC32-related stuff diverged
too much (`HAVE_POWER8`, `HAVE_PCLMUL`, `NO_THREEWAY_CRC32C`).

The patch strictly targets Ceph Luminous branch.

Fixes: http://tracker.ceph.com/issues/22534
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
7 years agoUse L1 size as estimate for L0 size in LevelCompactionBuilder::GetPathID
PhaniShekhar [Thu, 21 Sep 2017 22:50:46 +0000 (15:50 -0700)]
Use L1 size as estimate for L0 size in LevelCompactionBuilder::GetPathID

Summary:
Fix for [2461](https://github.com/facebook/rocksdb/issues/2461).

Problem: When using multiple db_paths setting with RocksDB, RocksDB incorrectly calculates the size of L1 in LevelCompactionBuilder::GetPathId.

max_bytes_for_level_base is used as L0 size and L1 size is calculated as (L0 size * max_bytes_for_level_multiplier). However, L1 size should be max_bytes_for_level_base.

Solution: Use max_bytes_for_level_base as L1 size. Also, use L1 size as the estimated size of L0.
Closes https://github.com/facebook/rocksdb/pull/2903

Differential Revision: D5885442

Pulled By: maysamyabandeh

fbshipit-source-id: 036da1c9298d173b9b80479cc6661ee4b7a951f6

8 years agocmake: disable SSE4.2 by default
Kefu Chai [Fri, 15 Sep 2017 02:18:45 +0000 (10:18 +0800)]
cmake: disable SSE4.2 by default

this commit is not cherry-picked from fb upstream, as it added "PORTABLE"
and "FORCE_SSE42" to do this.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
8 years agospecify SSE42 'target' attribute for Fast_CRC32()
Kefu Chai [Thu, 7 Sep 2017 19:32:50 +0000 (12:32 -0700)]
specify SSE42 'target' attribute for Fast_CRC32()

Summary:
if we enable SSE42 globally when compiling the tree for preparing a
portable binary, which could be running on CPU w/o SSE42 instructions
even the GCC on the building host is able to emit SSE42 code, this leads
to illegal instruction errors on machines not supporting SSE42. to solve
this problem, crc32 detects the supported instruction at runtime, and
selects the supported CRC32 implementation according to the result of
`cpuid`. but intrinics like "_mm_crc32_u64()" will not be available
unless the "target" machine is appropriately specified in the command
line, like "-msse42", or using the "target" attribute.

we could pass "-msse42" only when compiling crc32c.cc, and allow the
compiler to generate the SSE42 instructions, but we are still at the
risk of executing illegal instructions on machines does not support
SSE42 if the compiler emits code that is not guarded by our runtime
detection. and we need to do the change in both Makefile and CMakefile.

or, we can use GCC's "target" attribute to enable the machine specific
instructions on certain function. in this way, we have finer grained
control of the used "target". and no need to change the makefiles. so
we don't need to duplicate the changes on both makefile and cmake as
the previous approach.

this problem surfaces when preparing a package for GNU/Linux distribution,
and we only applies to optimization for SSE42, so using a feature
only available on GCC/Clang is not that formidable.
Closes https://github.com/facebook/rocksdb/pull/2807

Differential Revision: D5786084

Pulled By: siying

fbshipit-source-id: bca5c0f877b8d6fb55f58f8f122254a26422843d
(cherry picked from commit ba3c58cab6c691c53c7f98589651233695da1f62)

8 years agoDisable two flaky tests
Siying Dong [Thu, 27 Apr 2017 00:12:28 +0000 (17:12 -0700)]
Disable two flaky tests

Summary: Closes https://github.com/facebook/rocksdb/pull/2217

Differential Revision: D4959351

Pulled By: siying

fbshipit-source-id: ce7c3a430bae0d15e06b3d5c958ebce969d08564

8 years agofix WritableFile buffer size in direct IO
Aaron Gao [Wed, 26 Apr 2017 22:28:50 +0000 (15:28 -0700)]
fix WritableFile buffer size in direct IO

Summary:
�fix the buffer size in case of ppl use buffer size as their block_size.
Closes https://github.com/facebook/rocksdb/pull/2198

Differential Revision: D4956878

Pulled By: lightmark

fbshipit-source-id: 8bb0dc9c133887aadcd625d5261a3d1110b71473

8 years agoAdd user stats Reset API
Andrew Kryczka [Wed, 26 Apr 2017 22:19:50 +0000 (15:19 -0700)]
Add user stats Reset API

Summary:
It resets all the ticker and histogram stats to zero. Needed to change the locking a bit since Reset() is the only operation that manipulates multiple tickers/histograms together, and that operation should be seen as atomic by other operations that access tickers/histograms.
Closes https://github.com/facebook/rocksdb/pull/2213

Differential Revision: D4952232

Pulled By: ajkr

fbshipit-source-id: c0475c3e4c7b940120d53891b69c3091149a0679

8 years agoadd prefetch to PosixRandomAccessFile in buffered io
Aaron Gao [Wed, 26 Apr 2017 21:21:04 +0000 (14:21 -0700)]
add prefetch to PosixRandomAccessFile in buffered io

Summary:
Every time after a compaction/flush finish, we issue user reads to put the table into block cache which includes a couple of IO that read footer, index blocks, meta block, etc. So we implement Prefetch here to reduce IO.
Closes https://github.com/facebook/rocksdb/pull/2196

Differential Revision: D4931782

Pulled By: lightmark

fbshipit-source-id: 5a13d58dcab209964352322217193bbf7ff78149

8 years agoExtract statistics tests into separate file
Andrew Kryczka [Wed, 26 Apr 2017 21:18:58 +0000 (14:18 -0700)]
Extract statistics tests into separate file

Summary:
I'm going to add more DB tests for statistics as currently we have very few. I started a file dedicated to this purpose and moved the existing stats-specific tests there.
Closes https://github.com/facebook/rocksdb/pull/2211

Differential Revision: D4951558

Pulled By: ajkr

fbshipit-source-id: 05d11c35079c40ecabdfd2cf5556ccb761f694a4

8 years agosupport bulk loading with universal compaction
Aaron Gao [Wed, 26 Apr 2017 20:28:39 +0000 (13:28 -0700)]
support bulk loading with universal compaction

Summary:
Support buck load with universal compaction.
More test cases to be added.
Closes https://github.com/facebook/rocksdb/pull/2202

Differential Revision: D4935360

Pulled By: lightmark

fbshipit-source-id: cc3ca1b6f42faa503207dab1408d6bcf393ee5b5

8 years agoadd <sys/sysmacros.h> to avoid warning with glibc 2.25
Aaron Gao [Wed, 26 Apr 2017 08:09:05 +0000 (01:09 -0700)]
add <sys/sysmacros.h> to avoid warning with glibc 2.25

Summary:
https://github.com/facebook/rocksdb/issues/2152
Closes https://github.com/facebook/rocksdb/pull/2208

Differential Revision: D4945577

Pulled By: lightmark

fbshipit-source-id: 4e679150f2c9443d3be0b6008b26b65fabbda75a

8 years agoReunite checkpoint and backup core logic
Andrew Kryczka [Mon, 24 Apr 2017 21:57:27 +0000 (14:57 -0700)]
Reunite checkpoint and backup core logic

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

8 years agocall GetRootDB() before cast to DBImpl* in CancelAllBackgroundWork
Aaron Gao [Mon, 24 Apr 2017 20:38:29 +0000 (13:38 -0700)]
call GetRootDB() before cast to DBImpl* in CancelAllBackgroundWork

Summary:
User could call this with wrapper class of DB or DBImpl
Closes https://github.com/facebook/rocksdb/pull/2200

Differential Revision: D4935530

Pulled By: lightmark

fbshipit-source-id: df9cb61d67d0f3bbcf62f714d77523a459a92883