Repository navigation
Clear memcache keys after unlock - #16800
icewind1991 wants to merge 3 commits into
Conversation
|
A new inspection was created. |
|
@icewind1991 did you have a look if it was possible to use a transaction instead of Lua scripts ? |
|
I'll have a test nevertheless. |
|
Transactions dont allow conditional statements which we need here. According to the redis documentation the overhead for using a script is very low |
|
Hmm right. I was wrong in my reasoning. |
There was a problem hiding this comment.
seriously? Do we want to walk this path?
There was a problem hiding this comment.
And I thought I have seen everything 😄
|
Tested with csync's "t1.pl" suite. The keys were properly removed afterwards. 👍 I'd also like to get an opinion from redis fan @butonic I do agree with @DeepDiver1975 that using Lua scripts sounds wrong here. Isn't it possible to start a transaction in one call, read a value in PHP, then delete it, then finish the transaction ? It seems that the MULTI command is only for passing a one-shot multi-list of commands. |
well - the original idea (as in design precondition) was to NOT use the database because we wanted easy and fast (?) access. Meanwhile this sounds as complicated as doing it directly in the database. Time for a database based locking provider?????? |
|
I will try it with using WATCH but I would think this approach is faster since there are less roundtrips to redis |
|
076810c implements cas and cad using We should check if there is a significant performance difference between the implementations |
|
@icewind1991 I submit your branch as PR here #16821 (because floating branches/commits aren't convenient to review) |
|
@icewind1991 test results here: #16821 (comment) I still vote for the WATCH approach |
|
Closing in favor of #16821 |

This adds compare-and-delete to the memcache backend (emulated for everything but redis atm)
For redis cad and cas are implemented using eval which allows running lua scripts atomically on the server.
cc @DeepDiver1975 @PVince81