-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add alloptions workaround. #1
Conversation
Much like in humanmade/memcache-object-cache@a471be4 we workaroudn the core behaviour of storing all options in a single memcached object, which causes a lot of race conditions. Instead, we hook in on add / set / get and delete and specially handle the alloptions key, to split it up and store them each in their own memcached object,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few minor changes to avoid an inefficiency.
@@ -1185,6 +1189,10 @@ public function delete( $key, $group = 'default', $time = 0, $server_key = '', $ | |||
return true; | |||
} | |||
|
|||
if ( $key === 'alloptions' && $group === 'options' ) { | |||
return $this->deleteAllOptions(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be moved above the other lines here.
@@ -1286,6 +1294,9 @@ public function get( $key, $group = 'default', $force = false, &$found = null, $ | |||
// Assume object is not found | |||
$found = false; | |||
|
|||
if ( $key === 'alloptions' && $group === 'options' ) { | |||
return $this->getAllOptions(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be moved to the top.
Ok fixed up! |
Much like in
humanmade/memcache-object-cache@a471be4
we workaroudn the core behaviour of storing all options in a single
memcached object, which causes a lot of race conditions. Instead, we
hook in on add / set / get and delete and specially handle the
alloptions key, to split it up and store them each in their own
memcached object,