-
Notifications
You must be signed in to change notification settings - Fork 87
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
Document limitations of locks issued #62
Comments
I now see this has already been discussed, but it doesn’t seem like a resolution was reached and instead the issue was locked. #1 |
Ya what happened in that thread for it to just go dead. |
The paper even recommends to not do what this library does: "Avoid heartbeating leases in a background thread" yet that's what |
Yeah, this lock client actually targets "efficiency" instead of "correctness". if during the processing the lock expires, there's no way to check that. Even with the "fencing token" mentioned by Martin, there can still be race conditions because "validating the token" and "take the writes" are not atomic operations and don't happen instantaneously. |
There's a way to ensure correctness, but the supported use case is very limited (e.g. by relying on a CAS provided by db system, can work iff lock and resource access are in the same table/row) |
The documentation states that e.g if used for leader election the lock can be relied upon to ensure there is only one leader.
As per https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html which is referenced in Amazons own library https://aws.amazon.com/builders-library/leader-election-in-distributed-systems/ this isn’t correct without a fence using a monotonic version number.
This library seems to only use a UUID for the record version meaning clients can’t implement a fence correctly.
Could the documentation either mention thIs limitation or mention how a fence can be implemented by clients if I’ve missed something.
The text was updated successfully, but these errors were encountered: