Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 8b73a76

Browse files
committed
Don't take over of Percona Server slow log roation if slow log rotation is disabled.
1 parent 7ebc053 commit 8b73a76

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

qan/analyzer/mysql/analyzer.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ func (a *RealAnalyzer) TakeOverPerconaServerRotation() error {
165165
a.logger.Debug("TakeOverPerconaServerRotation:call")
166166
defer a.logger.Debug("TakeOverPerconaServerRotation:return")
167167

168+
// If slow log rotation is disabled, don't take over Percona Server slow log rotation.
169+
if !boolValue(a.config.SlowLogRotation) {
170+
return nil
171+
}
172+
168173
// max_slowlog_size: https://www.percona.com/doc/percona-server/LATEST/flexibility/slowlog_rotation.html#max_slowlog_size
169174
maxSlowLogSizeNullInt64, err := a.mysqlConn.GetGlobalVarInteger("max_slowlog_size")
170175
if err != nil {
@@ -451,3 +456,12 @@ func (a *RealAnalyzer) runWorker(interval *iter.Interval) {
451456
a.logger.Warn("Lost report:", err)
452457
}
453458
}
459+
460+
// boolValue returns the value of the bool pointer passed in or
461+
// false if the pointer is nil.
462+
func boolValue(v *bool) bool {
463+
if v != nil {
464+
return *v
465+
}
466+
return false
467+
}

0 commit comments

Comments
 (0)