From 482b5af88e22fc600bae933cd7180c3186aac078 Mon Sep 17 00:00:00 2001 From: jiefenghuang Date: Thu, 26 Dec 2024 16:13:56 +0800 Subject: [PATCH] add log Signed-off-by: jiefenghuang --- pkg/meta/sql.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/meta/sql.go b/pkg/meta/sql.go index cdbe46a52746..e689959e5186 100644 --- a/pkg/meta/sql.go +++ b/pkg/meta/sql.go @@ -840,6 +840,9 @@ func (m *dbMeta) txn(f func(s *xorm.Session) error, inodes ...Ino) error { if eno, ok := err.(syscall.Errno); ok && eno == 0 { err = nil } + if err != nil { + logger.Warnf("Transaction failed: %s", err) + } if err != nil && m.shouldRetry(err) { m.txRestart.Add(1) logger.Debugf("Transaction failed, restart it (tried %d): %s", i+1, err)