mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
Ensure that Autopilot sees all nodes in KnownServers at outset (#24246)
This commit is contained in:
parent
85b3dba310
commit
31ccb2667a
2 changed files with 15 additions and 9 deletions
3
changelog/24246.txt
Normal file
3
changelog/24246.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
storage/raft: Fix a race whereby a new leader may present inconsistent node data to Autopilot.
|
||||
```
|
||||
|
|
@ -314,14 +314,6 @@ func (c *Core) setupRaftActiveNode(ctx context.Context) error {
|
|||
c.logger.Info("starting raft active node")
|
||||
raftBackend.SetEffectiveSDKVersion(c.effectiveSDKVersion)
|
||||
|
||||
autopilotConfig, err := c.loadAutopilotConfiguration(ctx)
|
||||
if err != nil {
|
||||
c.logger.Error("failed to load autopilot config from storage when setting up cluster; continuing since autopilot falls back to default config", "error", err)
|
||||
}
|
||||
disableAutopilot := c.disableAutopilot
|
||||
|
||||
raftBackend.SetupAutopilot(c.activeContext, autopilotConfig, c.raftFollowerStates, disableAutopilot)
|
||||
|
||||
c.pendingRaftPeers = &sync.Map{}
|
||||
|
||||
// Reload the raft TLS keys to ensure we are using the latest version.
|
||||
|
|
@ -334,7 +326,18 @@ func (c *Core) setupRaftActiveNode(ctx context.Context) error {
|
|||
if err := c.monitorUndoLogs(); err != nil {
|
||||
return err
|
||||
}
|
||||
return c.startPeriodicRaftTLSRotate(ctx)
|
||||
|
||||
if err := c.startPeriodicRaftTLSRotate(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
autopilotConfig, err := c.loadAutopilotConfiguration(ctx)
|
||||
if err != nil {
|
||||
c.logger.Error("failed to load autopilot config from storage when setting up cluster; continuing since autopilot falls back to default config", "error", err)
|
||||
}
|
||||
disableAutopilot := c.disableAutopilot
|
||||
raftBackend.SetupAutopilot(c.activeContext, autopilotConfig, c.raftFollowerStates, disableAutopilot)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Core) stopRaftActiveNode() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue