String type instead of error type and changelog.
This commit is contained in:
parent
3a1afd8f57
commit
5c34a48d45
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
acl: replication routine to report the last error message.
|
||||
```
|
|
@ -484,12 +484,12 @@ func (s *Server) IsACLReplicationEnabled() bool {
|
|||
s.config.ACLTokenReplication
|
||||
}
|
||||
|
||||
func (s *Server) updateACLReplicationStatusError(errorMsg error) {
|
||||
func (s *Server) updateACLReplicationStatusError(errorMsg string) {
|
||||
s.aclReplicationStatusLock.Lock()
|
||||
defer s.aclReplicationStatusLock.Unlock()
|
||||
|
||||
s.aclReplicationStatus.LastError = time.Now().Round(time.Second).UTC()
|
||||
s.aclReplicationStatus.LastErrorMessage = errorMsg.Error()
|
||||
s.aclReplicationStatus.LastErrorMessage = errorMsg
|
||||
}
|
||||
|
||||
func (s *Server) updateACLReplicationStatusIndex(replicationType structs.ACLReplicationType, index uint64) {
|
||||
|
|
|
@ -810,7 +810,7 @@ func (s *Server) runLegacyACLReplication(ctx context.Context) error {
|
|||
0,
|
||||
)
|
||||
lastRemoteIndex = 0
|
||||
s.updateACLReplicationStatusError(err)
|
||||
s.updateACLReplicationStatusError(err.Error())
|
||||
legacyACLLogger.Warn("Legacy ACL replication error (will retry if still leader)", "error", err)
|
||||
} else {
|
||||
metrics.SetGauge([]string{"leader", "replication", "acl-legacy", "status"},
|
||||
|
@ -927,7 +927,7 @@ func (s *Server) runACLReplicator(
|
|||
0,
|
||||
)
|
||||
lastRemoteIndex = 0
|
||||
s.updateACLReplicationStatusError(err)
|
||||
s.updateACLReplicationStatusError(err.Error())
|
||||
logger.Warn("ACL replication error (will retry if still leader)",
|
||||
"error", err,
|
||||
)
|
||||
|
|
|
@ -97,6 +97,7 @@ type ACLReplicationStatus struct {
|
|||
ReplicatedTokenIndex uint64
|
||||
LastSuccess time.Time
|
||||
LastError time.Time
|
||||
LastErrorMessage string
|
||||
}
|
||||
|
||||
// ACLServiceIdentity represents a high-level grant of all necessary privileges
|
||||
|
|
Loading…
Reference in New Issue