New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterator to reference SuperVersion from a pool, just like the thread-local super version technique used in Get() #4765
Comments
Hi @siying , I'd like to try and take this on. |
@jwasinger awesome! Let me know if you need any help. CC @ajkr |
I can't assign it to you. I don't know much about github system, but you are more than welcome to work on it! |
Thanks :) . I will reach out with questions as they arise. |
Btw this is @nbronson 's suggestion. |
I think it's a good idea to have a pool of cached super versions for iterators. A couple thoughts: (1) Before extending this change to |
@ajkr how about core ID as a hint and can fall back to random? |
@ajkr I updated the original description according to your comment. |
sure, that sounds good. then a thread serially creating short-lived iterators might get some benefit. |
@siying @ajkr , I've done a bit of a dive through the docs and codebase to get myself up to speed. I still have a lot of reading to do to get a full idea of what is going on.
|
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.
The text was updated successfully, but these errors were encountered: