-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch introduces new failover mode - stateful. There are 3 main concepts: **Internal coordinator** is a new role, which makes decisions regarding leadership. Earlier it was a part of every instances' failover module, but now it's split away. There may be only one active coordinator in cluster at a time. Its uniqueness is ensured by external storage which manages the lock and saves appointments. **External storage** (`kingdom.lua`) is a stand-alone Tarantool instance which provides locking mechanism and keeps decisions made by the coordinator. **Failover module** (the old one) operates on every instance in cluster and gathers leadership information for others modules. It was refactored too, and now it can be described with 4 functions with clearly separated responsibilities: - `_get_appointments_*` generates leadership map by itself or polls it from external storage depending on the mode setting (disabled/eventual/stateful). - `accept_appointments()` just refreshes the cache and tracks if anything changed. - `failover_loop` (a fiber) repeatedly gets new appointments and accepts them using corresponding functions from the above. - `cfg` is called from `confapplier.apply_config()` (on restart or on committing new clusterwide configuration). At first it gets appointments synchronously and then starts the failover loop.
- Loading branch information
Showing
14 changed files
with
1,234 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.