Let’s say you have a transaction T1 that needs access to two resources, located on two different shards, such that it needs to do the following operations:
- LOCK (T1, R[0], S[0])
- LOCK (T1, R[1], S[1])
Then let’s say another transaction T2 comes in that wants access to the same resources:
- LOCK (T2, R[0], S[0])
- LOCK (T2, R[1], S[1])
Then let’s say this is what actually gets executed:
- LOCK (T1, R[0], S[0])
- LOCK (T2, R[1], S[1])
Now, neither T1 or T2 can proceed, hence deadlock.