Created
November 18, 2013 02:33
-
-
Save tav/7521514 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
dynamodb election: | |
- find node responsible for key K | |
- look up K 'master' | |
- value in K is of the format <seqid>|<status>|<address>|<port> | |
- if addr:port is self and status != C, then assume role, incr seqid and poll/update K every N/2 | |
- connect to addr:port | |
- if connected, it would only respond with results if it is still within timer, | |
else it would send back notification of not-responsible-any-more. | |
- if not responsible, check store again | |
- else, initiate new election | |
- CAS with status set to "C" (Contested) | |
- wait N seconds | |
- if node exists, it would have updated status back to OK | |
- CAS with new address and port | |
- if leader, check K every N/2 and set status to OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment