Re:Is Redlock Safe? Reply to Redlock Analysis
by YZF on Tuesday February 09, 2016 @11:20AM
(#11066313)
What happens when you sent the increment and then failed to send the decrement? The problem isn't typically the eventual consistency aspect, though that can also be a problem since you want the balance to be accurate, but rather the transactional nature.
[ Parent
| on HN ]
Re:Is Redlock Safe? Reply to Redlock Analysis
by jedberg on Tuesday February 09, 2016 @11:29AM
(#11066409)
How would a global lock fix this? Presumably you would have a process that is trying to decrement get a global lock and then crash, and eventually release the lock anyway, right? So you get the same outcome.
Re:Is Redlock Safe? Reply to Redlock Analysis
by YZF on Tuesday February 09, 2016 @11:56AM
(#11066681)
You can build things like 2 phase locking on top of that. You're right though that simply taking a lock before updating two values doesn't solve the atomicity of that update problem. However if you're updating a single value then taking a lock can make your life easier vs. systems with no locks and eventual consistency.