Requests (by a Chubby client) submitted to a Chubby cell are directed to the current Chubby master replica.
From the time when the master replica receives the request to the moment the request causes an update of
the underlying database, the replica may have lost its master status. It may even have lost master status and
regained it again. Chubby requires an incoming request to be aborted if mastership is lost and/or re-acquired
during the handling of the request. We needed a mechanism to reliably detect master turnover and abort
operations if necessary.
We solved this problem by introducing a global epoch number with the following semantics. Two requests
for the epoch number at the master replica receive the same value iff that replica was master continuously
for the time interval between the two requests. The epoch number is stored as an entry in the database, and
all database operations are made conditional on the value of the epoch number.