Skip to content
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

Lucene FDBDirectory should cache file counter #1577

Closed
alecgrieser opened this issue Mar 30, 2022 · 0 comments · Fixed by #1578
Closed

Lucene FDBDirectory should cache file counter #1577

alecgrieser opened this issue Mar 30, 2022 · 0 comments · Fixed by #1578
Assignees
Labels
performance Performance issues

Comments

@alecgrieser
Copy link
Contributor

The FDBDirectory implementation keeps track of a counter that is used to assign files an immutable internal ID, and then file names are linked to that ID via the "meta-data subspace". The current implementation re-reads that counter each time the counter is incremented. This should be served from the FDB-maintained RYW cache, so it shouldn't need to go all the way to a remote FDB cluster, but it could still be lifted up into the JVM and stored as an AtomicLong on the directory.

@alecgrieser alecgrieser added the performance Performance issues label Mar 30, 2022
@alecgrieser alecgrieser self-assigned this Mar 30, 2022
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Mar 30, 2022
…nter

This adds a new `AtomicLong` to the `FDBDirectory` where the file sequence counter is cached. The first time a user tries to get an increment, the value is loaded from the database and put into the cache. All subsequent accesses can use that cache, and the `AtomicLong` guarantees thread safety. Note that the FDB read-your-writes cache was already keeping a cached copy, but this removes the extra JNI hop and requirement to go through the FDB network thread in order to get a new increment.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Apr 5, 2022
…nter

This adds a new `AtomicLong` to the `FDBDirectory` where the file sequence counter is cached. The first time a user tries to get an increment, the value is loaded from the database and put into the cache. All subsequent accesses can use that cache, and the `AtomicLong` guarantees thread safety. Note that the FDB read-your-writes cache was already keeping a cached copy, but this removes the extra JNI hop and requirement to go through the FDB network thread in order to get a new increment.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Apr 9, 2022
…nter

This adds a new `AtomicLong` to the `FDBDirectory` where the file sequence counter is cached. The first time a user tries to get an increment, the value is loaded from the database and put into the cache. All subsequent accesses can use that cache, and the `AtomicLong` guarantees thread safety. Note that the FDB read-your-writes cache was already keeping a cached copy, but this removes the extra JNI hop and requirement to go through the FDB network thread in order to get a new increment.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Apr 9, 2022
…nter

This adds a new `AtomicLong` to the `FDBDirectory` where the file sequence counter is cached. The first time a user tries to get an increment, the value is loaded from the database and put into the cache. All subsequent accesses can use that cache, and the `AtomicLong` guarantees thread safety. Note that the FDB read-your-writes cache was already keeping a cached copy, but this removes the extra JNI hop and requirement to go through the FDB network thread in order to get a new increment.
tian-yizuo added a commit that referenced this issue Apr 21, 2022
Resolves #1577: Lucene FDBDirectory should cache file counter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant