]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/log
rocksdb.git
8 years agoMerge pull request #32 from aclamk/merging-skiplist-prefetch skiplist-with-prefetch
Sage Weil [Mon, 9 Oct 2017 14:36:20 +0000 (09:36 -0500)]
Merge pull request #32 from aclamk/merging-skiplist-prefetch

Added CPU prefetch for skiplist

8 years agoAdded CPU prefetch for skiplist 32/head
Adam Kupczyk [Thu, 5 Oct 2017 01:03:29 +0000 (18:03 -0700)]
Added CPU prefetch for skiplist

Summary:
This change causes following changes result of test:
./db_bench --writes 10000000 --benchmarks="fillrandom" --compression_type none
from
fillrandom   :       3.177 micros/op 314804 ops/sec;   34.8 MB/s
to
fillrandom   :       2.777 micros/op 360087 ops/sec;   39.8 MB/s
Closes https://github.com/facebook/rocksdb/pull/2961

Differential Revision: D5977822

Pulled By: yiwu-arbug

fbshipit-source-id: 1ea77707bffa978b1592b0c5d0fe76bfa1930f8d

8 years agoJNI support for ReadOptions::iterate_upper_bound
Ben Clay [Fri, 15 Sep 2017 01:18:49 +0000 (18:18 -0700)]
JNI support for ReadOptions::iterate_upper_bound

Summary:
Plumbed ReadOptions::iterate_upper_bound through JNI.

Made the following design choices:
* Used Slice instead of AbstractSlice due to the anticipated usecase (key / key prefix). Can change this if anyone disagrees.
* Used Slice instead of raw byte[] which seemed cleaner but necessitated the package-private handle-based Slice constructor. Followed WriteBatch as an example.
* We need a copy constructor for ReadOptions, as we create one base ReadOptions for a particular usecase and clone -> change the iterate_upper_bound on each slice operation. Shallow copy seemed cleanest.
* Hold a reference to the upper bound slice on ReadOptions, in contrast to Snapshot.

Signed a Facebook CLA this morning.
Closes https://github.com/facebook/rocksdb/pull/2872

Differential Revision: D5824446

Pulled By: sagar0

fbshipit-source-id: 74fc51313a10a81ecd348625e2a50ca5b7766888

8 years agoThree code-level optimization to Iterator::Next()
Siying Dong [Fri, 15 Sep 2017 00:43:41 +0000 (17:43 -0700)]
Three code-level optimization to Iterator::Next()

Summary:
Three small optimizations:
(1) iter_->IsKeyPinned() shouldn't be called if read_options.pin_data is not true. This may trigger function call all the way down the iterator tree.
(2) reuse the iterator key object in DBIter::FindNextUserEntryInternal(). The constructor of the class has some overheads.
(3) Move the switching direction logic in MergingIterator::Next() to a separate function.

These three in total improves readseq performance by about 3% in my benchmark setting.
Closes https://github.com/facebook/rocksdb/pull/2880

Differential Revision: D5829252

Pulled By: siying

fbshipit-source-id: 991aea10c6d6c3b43769cb4db168db62954ad1e3

8 years agoTwo small refactoring for better inlining
Siying Dong [Thu, 14 Sep 2017 22:41:19 +0000 (15:41 -0700)]
Two small refactoring for better inlining

Summary:
Move uncommon code paths in RangeDelAggregator::ShouldDelete() and IterKey::EnlargeBufferIfNeeded() to a separate function, so that the inlined strcuture can be more optimized.

Optimize it because these places show up in CPU profiling, though minimum. The performance is really hard measure. I ran db_bench with readseq benchmark against in-memory DB many times. The variation is big, but it seems to show 1% improvements.
Closes https://github.com/facebook/rocksdb/pull/2877

Differential Revision: D5828123

Pulled By: siying

fbshipit-source-id: 41a49e229f91e9f8409f85cc6f0dc70e31334e4b

8 years agoAdded save points for transactions C API
Oleksandr Anyshchenko [Thu, 14 Sep 2017 21:04:40 +0000 (14:04 -0700)]
Added save points for transactions C API

Summary:
Added possibility to set save points in transactions and then rollback to them
Closes https://github.com/facebook/rocksdb/pull/2876

Differential Revision: D5825829

Pulled By: yiwu-arbug

fbshipit-source-id: 62168992340bbcddecdaea3baa2a678475d1429d

8 years agoFix WriteBatchWithIndex::GetFromBatchAndDB not allowing StackableDB
Yi Wu [Thu, 14 Sep 2017 00:21:35 +0000 (17:21 -0700)]
Fix WriteBatchWithIndex::GetFromBatchAndDB not allowing StackableDB

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

Differential Revision: D5829682

Pulled By: yiwu-arbug

fbshipit-source-id: abb8fa14b58cea7c416282f9be19e8b1a7961c6e

8 years agoFix use-after-free in c_tset
Yi Wu [Wed, 13 Sep 2017 22:56:57 +0000 (15:56 -0700)]
Fix use-after-free in c_tset

Summary:
Fix asan error introduce by #2823
Closes https://github.com/facebook/rocksdb/pull/2879

Differential Revision: D5828454

Pulled By: yiwu-arbug

fbshipit-source-id: 50777855667f4e7b634279a654c3bfa01a1ac729

8 years agoRemove 'experimental' comment around level_compaction_dynamic_level_bytes option
Sagar Vemuri [Wed, 13 Sep 2017 22:50:38 +0000 (15:50 -0700)]
Remove 'experimental' comment around level_compaction_dynamic_level_bytes option

Summary:
Remove misleading 'experimental' comment around `level_compaction_dynamic_level_bytes` option. This is not experimental anymore and is ready for wider adoption. MyRocks is already using it in production.
Closes https://github.com/facebook/rocksdb/pull/2878

Differential Revision: D5828890

Pulled By: sagar0

fbshipit-source-id: fffb45f4999f689b7eca326e4f4caf472d40c5a9

8 years agofix hanging after CompactFiles with L0 overlap
Andrew Kryczka [Wed, 13 Sep 2017 22:31:34 +0000 (15:31 -0700)]
fix hanging after CompactFiles with L0 overlap

Summary:
Bug report: https://www.facebook.com/groups/rocksdb.dev/permalink/1389452781153232/

Non-empty `level0_compactions_in_progress_` was aborting `CompactFiles` after incrementing `bg_compaction_scheduled_`, and in that case we never decremented it. This blocked future compactions and prevented DB close as we wait for scheduled compactions to finish/abort during close.

I eliminated `CompactFiles`'s dependency on `level0_compactions_in_progress_`. Since it takes a contiguous span of L0 files -- through the last L0 file if any L1+ files are included -- it's fine to run in parallel with other compactions involving L0. We make the same assumption in intra-L0 compaction.
Closes https://github.com/facebook/rocksdb/pull/2849

Differential Revision: D5780440

Pulled By: ajkr

fbshipit-source-id: 15b15d3faf5a699aed4b82a58352d4a7bb23e027

8 years agoWritePrepared Txn: Lock-free CommitMap
Maysam Yabandeh [Wed, 13 Sep 2017 18:56:27 +0000 (11:56 -0700)]
WritePrepared Txn: Lock-free CommitMap

Summary:
We had two proposals for lock-free commit maps. This patch implements the latter one that was simpler. We can later experiment with both proposals.

In this impl each entry is an std::atomic of uint64_t, which are accessed via memory_order_acquire/release. In x86_64 arch this is compiled to simple reads and writes from memory.
Closes https://github.com/facebook/rocksdb/pull/2861

Differential Revision: D5800724

Pulled By: maysamyabandeh

fbshipit-source-id: 41abae9a4a5df050a8eb696c43de11c2770afdda