It’s worth noting that at this point I consider yanking to be a superior alternative to all of these locking techniques. So the process becomes:
- User sends a message to resource A to yank it to the same shard as resource B
- Resource A arrives at the same shard.
- (i) user does an intra-shard tx involving both A and B, or (ii) someone else uses resource A in some way, including possibly yanking it to another shard, whichever comes first
There’s no concept of “locked” and “unlocked”; every resource is at all times either “locked to” a particular shard (by being located inside of that shard) or “in transit” (unusable by any shard).