mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-29 17:52:32 +00:00 
			
		
		
		
	Ensure that Autopilot sees all nodes in KnownServers at outset (#24246)
This commit is contained in:
		
							
								
								
									
										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() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nick Cabatoff
					Nick Cabatoff