1
0
Fork 0

Remove some excessive logging

master
Philip O'Toole 9 months ago
parent c3e4fe9644
commit bf18b3fab5

@ -12,6 +12,7 @@ This release adds new control over Raft snapshotting, a key part of the Raft con
- [PR #1535](https://github.com/rqlite/rqlite/pull/1535): Refactor using CommandProcessor.
- [PR #1539](https://github.com/rqlite/rqlite/pull/1539): `go mod` updates.
- [PR #1540](https://github.com/rqlite/rqlite/pull/1540): Friendlier display of database sizes.
- [PR #1543](https://github.com/rqlite/rqlite/pull/1543): Remove some excessive logging.
## 8.13.5 (December 26th 2023)
### Implementation changes and bug fixes

@ -23,6 +23,7 @@ const (
persistDuration = "latest_persist_duration"
upgradeOk = "upgrade_ok"
upgradeFail = "upgrade_fail"
snapshotsReaped = "snapshots_reaped"
)
const (
@ -46,6 +47,7 @@ func ResetStats() {
stats.Add(persistDuration, 0)
stats.Add(upgradeOk, 0)
stats.Add(upgradeFail, 0)
stats.Add(snapshotsReaped, 0)
}
// LockingSink is a wrapper around a SnapshotSink that ensures that the
@ -201,7 +203,11 @@ func (s *Store) Stats() (map[string]interface{}, error) {
// Reap reaps all snapshots, except the most recent one. Returns the number of
// snapshots reaped.
func (s *Store) Reap() (int, error) {
func (s *Store) Reap() (retN int, retErr error) {
defer func() {
stats.Add(snapshotsReaped, int64(retN))
}()
snapshots, err := s.getSnapshots()
if err != nil {
return 0, err
@ -215,7 +221,6 @@ func (s *Store) Reap() (int, error) {
if err := removeAllPrefix(s.dir, snap.ID); err != nil {
return n, err
}
s.logger.Printf("reaped snapshot %s", snap.ID)
n++
}
return n, nil

@ -1717,7 +1717,6 @@ func (s *Store) fsmSnapshot() (fSnap raft.FSMSnapshot, retErr error) {
return nil, err
}
fPLog := fullPretty(fullNeeded)
s.logger.Printf("initiating %s snapshot on node ID %s", fPLog, s.raftID)
defer func() {
s.numSnapshotsMu.Lock()
defer s.numSnapshotsMu.Unlock()
@ -1767,8 +1766,6 @@ func (s *Store) fsmSnapshot() (fSnap raft.FSMSnapshot, retErr error) {
}
stats.Get(snapshotWALSize).(*expvar.Int).Set(int64(compactedBuf.Len()))
stats.Get(snapshotPrecompactWALSize).(*expvar.Int).Set(walSz)
s.logger.Printf("%s snapshot is %d bytes (WAL=%d bytes) on node ID %s", fPLog, compactedBuf.Len(),
walSz, s.raftID)
if err := s.db.Checkpoint(); err != nil {
return nil, err
}

Loading…
Cancel
Save