Hello everyone!
I am looking to implement locking support (as in binary semaphores, not I/O locking) on top of Tarantool in the context multi-master deployments.
In the case of single node or single master deployments, this should be straightforward as atomicity is guaranteed by the single thread implementation (other fibers will wait their turn while a lock is being acquired/released). There is also a nice off the shelf solution available
https://github.com/dreadatour/tarantool-locksmith
However, in a multi-master architecture, the concept is not (as) portable as, in the event of a potential race condition, the lock specific operations are not necessarily commutative with respect to the follow up operations when an object lock is being acquired/released:
https://tarantool.io/en/doc/2.0/book/replication/repl_duplicates/#commutative-changes -- therefore a naive lock implementation could be subject to (a) false lock assessment in the context of race conditions as well as (b) driving the replication process out of sync when Tarantool cannot reconcile data on competing master nodes.
Any advice on how to proper architect/model locks on multi-master Tarantool deployments is appreciated, thank you!