Last active
January 16, 2016 10:23
-
-
Save autrilla/312d16926e9bd892359b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| X marks intersection points | |
| Cliens want to write to a shared file | |
| All acceptors and learners start with no one ('null') having access | |
| ClientA ClientB Proposer Acceptor1 Acceptor2 Acceptor3 LearnerX LearnerY | |
| | | | | | | | | | |
| X------------------>| | | | | | Request(ClientA) | |
| | | X--------->|----------->|---------->| | | Prepare(transaction_id=1) | |
| | | |<---------X------------X-----------X | | Promise(transaction_id=1, {null, null, null}) // Acceptors answer with their current value, i.e. who currently has write access | |
| | | X--------->|----------->|---------->| | | Accept(transaction_id=1, ClientA) // The proposer decides to let ClientA access the file | |
| | | |<---------X------------X-----------X---------->|-------->| Accepted(transaction_id=1, ClientA) | |
| |<------------------------------------------------------------------X---------X Reponse(accepted) // Convey the information to ClientA | |
| | | | | | | | | | |
| | X-------->| | | | | | Request(ClientB) | |
| | | X--------->|----------->|---------->| | | Prepare(transaction_id=2) | |
| | | |<---------X------------X-----------X | | Promise(transaction_id=2, {ClientA, ClientA, ClientA}) | |
| | | X--------->|----------->|---------->| | | Accept(transaction_id=2, ClientA) // The proposer decides ClientA still has access to the file | |
| | | |<---------X------------X-----------X---------->|-------->| Accepted(transaction_id=2, ClientA) | |
| | |<--------------------------------------------------------X---------X Reponse(denied) // Convey the information to ClientA | |
| | | | | | | | | | |
| X------------------>| | | | | | Request(null) // ClientA doesn't want the file anymore | |
| | | X--------->|----------->|---------->| | | Prepare(transaction_id=3) | |
| | | |<---------X------------X-----------X | | Promise(transaction_id=3, {ClientA, ClientA, ClientA}) | |
| | | X--------->|----------->|---------->| | | Accept(transaction_id=3, null) | |
| | | |<---------X------------X-----------X---------->|-------->| Accepted(transaction_id=3, null) | |
| |<------------------------------------------------------------------X---------X Reponse(accept) // Convey the information to ClientA | |
| | | | | | | | | | |
| | X-------->| | | | | | Request(ClientB) | |
| | | X--------->|----------->|---------->| | | Prepare(transaction_id=4) | |
| | | |<---------X------------X-----------X | | Promise(transaction_id=4, {null, null, null}) | |
| | | X--------->|----------->|---------->| | | Accept(transaction_id=4, ClientB) // The proposer decides ClientB can now access the file | |
| | | |<---------X------------X-----------X---------->|-------->| Accepted(transaction_id=4, ClientB) | |
| | |<--------------------------------------------------------X---------X Reponse(accept) // Convey the information to ClientA | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment