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

perf: track bulk get operation completions explicitly #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonk000
Copy link
Member

This commit makes it so that the operation callbacks are used to collect all the locked state that we might need to access, which makes the code after latch-release run without contending memcached to complete.

Before this commit, callbacks on the bulk get operation accumulate the state and when all operations have completed, we release the latch and then the calller calculates the final state. Unfortunately looking at the state, the caller must take operation locks, which are potentially still hold by memcache driver since it has only momentarily before released the latch.

The Memcache callbacks are made whilst holding the lock on the Operation objects, which means they are a great time to get locked state such as cancellation state. This patch makes the change to collect state during callbacks. The callback future interaction is a little clunky, but this avoids a major rewrite of the implementations.

This commit makes it so that the operation callbacks are used to collect
all the locked state that we might need to access, which makes the code
after latch-release run without contending memcached to complete.

Before this commit, callbacks on the bulk get operation accumulate the
state and when all operations have completed, we release the latch and
then the calller calculates the final state. Unfortunately looking at
the state, the caller must take operation locks, which are potentially
still hold by memcache driver since it has only momentarily before
released the latch.

The Memcache callbacks are made whilst holding the lock on the Operation
objects, which means they are a great time to get locked state such as
cancellation state. This patch makes the change to collect state during
callbacks. The callback future interaction is a little clunky, but this
avoids a major rewrite of the implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant