Do not attempt to write a new TLS keyring at startup if raft is already setup (#17079)
This commit is contained in:
parent
5b5699e9b0
commit
3075c5bd65
|
@ -0,0 +1,2 @@
|
|||
```release-note:bug
|
||||
storage/raft: Fix error writing raft TLS keyring during follower joins
|
|
@ -73,14 +73,15 @@ func (c *Core) startRaftBackend(ctx context.Context) (retErr error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
var creating bool
|
||||
var raftTLS *raft.TLSKeyring
|
||||
if !raftBackend.Initialized() {
|
||||
// Retrieve the raft TLS information
|
||||
raftTLSEntry, err := c.barrier.Get(ctx, raftTLSStoragePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var creating bool
|
||||
var raftTLS *raft.TLSKeyring
|
||||
switch raftTLSEntry {
|
||||
case nil:
|
||||
// If this is HA-only and no TLS keyring is found, that means the
|
||||
|
@ -140,6 +141,7 @@ func (c *Core) startRaftBackend(ctx context.Context) (retErr error) {
|
|||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
|
|
Loading…
Reference in New Issue