Skip to content

Instantly share code, notes, and snippets.

@flashvoid
Created February 22, 2017 21:34
Show Gist options
  • Save flashvoid/eff9a38a29a1062c1abbe22ebf89ded4 to your computer and use it in GitHub Desktop.
Save flashvoid/eff9a38a29a1062c1abbe22ebf89ded4 to your computer and use it in GitHub Desktop.
DC-gip-design
Adding datacenter
syntax: `vipsmart dc add dc-1,192.168.0.99,9610`
Tells **local dc** to add **candidate dc** dc-1 to the federation.
If **local dc** is not federated yet it will decalre federation consisting
of itself and add **candidate dc**.
Important assumptions:
- **local dc** might not be federated yet, it will create a federation of itself and add **candidate dc**
- **candidate dc** can't be federated, it can't have any DC or GIP objects in it's store
- **local dc** might be federated already, it mnust make sure that every other DC in federation will add **candidate dc**
Workflow
- contact **candidate dc** and ensure it has no DC or GIP objects
- set **candidate dc** status to `invited`, status will expire and revert to default `standalone` after some timeout
- - while DC in status `invited` it will refuse to add any VIPs and refuse any federation requests
- contact every other `member` of federation and switch their status to `candidate review` status
- - while in `candidate review` DC won't be accepting any changes to it's VIPs or GIPs, it won't accept any federation related requests, the status expires.
- - if not `member` is ready to accept **candidate dc** (can't reach a DC or not in `member` state), **candidate dc** is reverted into `standalone` mode, every other DC in federation is reverted to `member` status, and request ultimately fails.
```
+-------------+ +---------+ +-------------+
| | | | | |
| standalone +---> invited +--> member |
| | | | | |
+------^------+ +---------+ +------+------+
| |
| |
+------+------+ +-------------v------+
| | | |
| leaving <---------+ candidate-review |
| | | |
+-------------+ +--------------------+
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment