storage/raft: Refresh TLS keyring on snapshot restore (#8546)

This commit is contained in:
Brian Kassouf 2020-03-13 13:39:14 -07:00 committed by GitHub
parent 74b06003fe
commit 84bb04eca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,6 +484,12 @@ func (c *Core) raftSnapshotRestoreCallback(grabLock bool, sealNode bool) func(co
// Purge the cache so we make sure we are operating on fresh data
c.physicalCache.Purge(ctx)
// Refresh the raft TLS keys
if err := c.checkRaftTLSKeyUpgrades(ctx); err != nil {
c.logger.Info("failed to perform TLS key upgrades, sealing", "error", err)
return err
}
// Reload the keyring in case it changed. If this fails it's likely
// we've changed master keys.
err := c.performKeyUpgrades(ctx)