fix(master): modify master error log and add some log for TryRun.#1000044182

Signed-off-by: baihailong <baihailong@oppo.com>
This commit is contained in:
baihailong 2025-04-14 14:21:42 +08:00 committed by zhumingze1108
parent a0cf5a13f1
commit f2365c1319
3 changed files with 13 additions and 1 deletions

View File

@ -117,7 +117,7 @@ func (mp *MetaPartition) checkInodeCount(c *Cluster) (isEqual bool) {
if !isEqual {
msg := fmt.Sprintf("inode count is not equal,vol[%v],mpID[%v],", mp.volName, mp.PartitionID)
for _, lr := range mp.LoadResponse {
lrMsg := fmt.Sprintf(msg+lr.Addr, "applyId[%d],committedId[%d],maxInode[%d],InodeCnt[%d]", lr.ApplyID, lr.CommittedID, lr.MaxInode, lr.InodeCount)
lrMsg := fmt.Sprintf(msg+"addr[%s],applyId[%d],committedId[%d],maxInode[%d],InodeCnt[%d]", lr.Addr, lr.ApplyID, lr.CommittedID, lr.MaxInode, lr.InodeCount)
Warn(c.Name, lrMsg)
}
if !maxInodeEqual {

View File

@ -26,6 +26,7 @@ import (
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/errors"
"github.com/cubefs/cubefs/util/log"
"github.com/cubefs/cubefs/util/stat"
)
// ExtentReader defines the struct of the extent reader.
@ -67,6 +68,15 @@ func (reader *ExtentReader) Read(req *ExtentRequest) (readBytes int, err error)
log.LogDebugf("ExtentReader Read enter: size(%v) req(%v) reqPacket(%v)", size, req, reqPacket)
err = sc.Send(&reader.retryRead, reqPacket, func(conn *net.TCPConn) (error, bool) {
bgTime := stat.BeginStat()
defer func() {
addr := conn.RemoteAddr().String()
parts := strings.Split(addr, ":")
if len(parts) > 0 {
stat.EndStat(fmt.Sprintf("dataNode:%v", parts[0]), err, bgTime, 1)
}
stat.EndStat("dataNode", err, bgTime, 1)
}()
readBytes = 0
for readBytes < size {
replyPacket := NewReply(reqPacket.ReqID, reader.dp.PartitionID, reqPacket.ExtentID)

View File

@ -117,6 +117,7 @@ func (l *IoLimiter) RunNoWait(size int, allowHang bool, taskFn func()) (err erro
func (l *IoLimiter) TryRun(size int, taskFn func()) bool {
if ok := l.getIO().TryRun(taskFn, false); !ok {
log.LogWarn("action[limitio] tryrun failed")
return false
}
if size > 0 {
@ -316,6 +317,7 @@ func (q *ioQueue) TryRun(taskFn func(), async bool) bool {
}
return true
default:
log.LogWarnf("TryRun queue.cap(%v) queue.len(%v) running(%v)", cap(q.queue), len(q.queue), q.running)
return false
}
}