Skip to content

Commit

Permalink
Increase COMPACT log messages to Info
Browse files Browse the repository at this point in the history
These messages are important for evaluating cluster heath and should be more visible.

Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Jan 26, 2023
1 parent ac5cd6c commit da5435a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/logstructured/sqllog/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ func (s *SQLLog) compact(compactRev int64, targetCompactRev int64) (int64, int64
return compactRev, targetCompactRev, errors.Wrap(err, "failed to get compact revision")
}

// Check to see if another node already compacted. This is normal on a multi-server cluster.
if compactRev != dbCompactRev {
logrus.Tracef("COMPACT compact revision changed since last iteration: %d => %d", compactRev, dbCompactRev)
logrus.Infof("COMPACT compact revision changed since last iteration: %d => %d", compactRev, dbCompactRev)
return dbCompactRev, currentRev, server.ErrCompacted
}

Expand All @@ -204,11 +205,11 @@ func (s *SQLLog) compact(compactRev int64, targetCompactRev int64) (int64, int64

// Don't bother compacting to a revision that has already been compacted
if targetCompactRev <= compactRev {
logrus.Tracef("COMPACT revision %d has already been compacted", targetCompactRev)
logrus.Infof("COMPACT revision %d has already been compacted", targetCompactRev)
return dbCompactRev, currentRev, server.ErrCompacted
}

logrus.Tracef("COMPACT compactRev=%d targetCompactRev=%d currentRev=%d", compactRev, targetCompactRev, currentRev)
logrus.Infof("COMPACT compactRev=%d targetCompactRev=%d currentRev=%d", compactRev, targetCompactRev, currentRev)

start := time.Now()
deletedRows, err := t.Compact(s.ctx, targetCompactRev)
Expand All @@ -221,7 +222,7 @@ func (s *SQLLog) compact(compactRev int64, targetCompactRev int64) (int64, int64
}

t.MustCommit()
logrus.Debugf("COMPACT deleted %d rows from %d revisions in %s - compacted to %d/%d", deletedRows, (targetCompactRev - compactRev), time.Since(start), targetCompactRev, currentRev)
logrus.Infof("COMPACT deleted %d rows from %d revisions in %s - compacted to %d/%d", deletedRows, (targetCompactRev - compactRev), time.Since(start), targetCompactRev, currentRev)

return targetCompactRev, currentRev, nil
}
Expand Down

0 comments on commit da5435a

Please sign in to comment.