facebook / facebook/rocksdb

Iterator to reference SuperVersion from a pool, just like the thread-local super version technique used in Get()

Open
#4,765 10 comments 4 reactions 0 assignees View on GitHub
up-for-grabs
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

Right now, we reduce the mutex contention of grabbing and referencing count super version using thread-local super version. See https://github.com/facebook/rocksdb/blob/v5.17.2/db/column_family.cc#L1027-L1070

This works well for Get(), but we can't directly use it in iterators. Instead, when creating a new iterator we still increase the reference count while getting it from the thread local cached super version. The reference count is still a potential scalability bottleneck. It isn't usually exposed as a bottleneck but it's a good idea to clean the design to get rid of it.

To achieve it, we can turn the thread-local cache to a pool of cached super version. While creating an iterator, we can fetch a random one (or a core-local one) from the pool and remember where we should return it to. In the future we can consider whether it makes sense to replace Get() path can migrate to the same solution too.

Anyone who is interested is welcome to contribute.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.