mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
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:
parent
a0cf5a13f1
commit
f2365c1319
@ -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 {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user