Commit 191dff7f authored by Petr Pudlak's avatar Petr Pudlak

Ensure full configuration distribution if MCs change

If a node is removed from the list of master candidates, we want to make
sure that after the operation the configuration will not be distributed
to the node any more. Without requiring full distribution, it's possible
that the node still receives configuration update from a previous call.

Also include the master node(s).
(While this shouldn't change without master failover, if it does, it's
definitely a good idea to flush the configuration.)
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 7e39b007
......@@ -38,6 +38,7 @@ import Control.Applicative
import Data.Function (on)
import System.Time (ClockTime(..))
import Ganeti.Config
import Ganeti.Lens
import Ganeti.Objects
import Ganeti.Objects.Lens
......@@ -65,5 +66,8 @@ bumpSerial now = set mTimeL now . over serialL succ
needsFullDist :: ConfigState -> ConfigState -> Bool
needsFullDist = on (/=) watched
where
watched = (,) <$> clusterCandidateCerts . configCluster . csConfigData
<*> clusterMasterNode . configCluster . csConfigData
watched = (,,,)
<$> clusterCandidateCerts . configCluster . csConfigData
<*> clusterMasterNode . configCluster . csConfigData
<*> getMasterNodes . csConfigData
<*> getMasterCandidates . csConfigData
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment