Skip to content

Commit

Permalink
Make rollback less spammy (#7136)
Browse files Browse the repository at this point in the history
We already have a separate log line if rollback fails. It really fills
up logs to always note when rollback is occurring and it usually isn't
useful for incidents.
  • Loading branch information
jefferai committed Jul 19, 2019
1 parent 96abc9b commit 34fd106
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vault/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ func (m *RollbackManager) startOrLookupRollback(ctx context.Context, fullPath st
// attemptRollback invokes a RollbackOperation for the given path
func (m *RollbackManager) attemptRollback(ctx context.Context, fullPath string, rs *rollbackState, grabStatelock bool) (err error) {
defer metrics.MeasureSince([]string{"rollback", "attempt", strings.Replace(fullPath, "/", "-", -1)}, time.Now())
if m.logger.IsDebug() {
m.logger.Debug("attempting rollback", "path", fullPath)
}

defer func() {
rs.lastError = err
Expand All @@ -181,9 +178,11 @@ func (m *RollbackManager) attemptRollback(ctx context.Context, fullPath string,

ns, err := namespace.FromContext(ctx)
if err != nil {
m.logger.Error("rollback failed to derive namespace from context", "path", fullPath)
return err
}
if ns == nil {
m.logger.Error("rollback found no namespace", "path", fullPath)
return namespace.ErrNoNamespace
}

Expand Down

0 comments on commit 34fd106

Please sign in to comment.