Thirty Three Arrives Late

Client C1 takes a 20 second lease at t = 1 s and gets fencing token 33. A stop-the-world pause freezes it from t = 5 s to t = 28 s. C2 acquires the same lock at t = 22 s and gets token 34.

Client 1 pauses across its lease expiry while client 2 acquires the lock and writes C1 C2 stop the world pause, t = 5 s to t = 28 s lease expires t = 21 s acquire write A write C acquire write B write D

The storage service enforces one rule: reject any write whose token is lower than the highest token it has already accepted. Four writes arrive.

t client token write
3 s C1 33 A
23 s C2 34 B
28 s C1 33 C
31 s C2 34 D

Which writes does the storage service accept?

A

A, C and D. B is rejected because C1's lease had not been released when B arrived.

B

A, B and D. C is rejected.

C

A and B only. C is rejected as stale and D is rejected as a duplicate token.

D

All four. The tokens only record who held the lock; the lease already guarantees exclusion.