mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(meta): add txId in audit log for dentryOp. #22871509
refactor tx retry default cfg when tx is conflicted to over default timeout cfg. Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
parent
ecc4444490
commit
877954e167
@ -31,7 +31,11 @@ func (mp *metaPartition) TxCreateDentry(req *proto.TxCreateDentryRequest, p *Pac
|
||||
start := time.Now()
|
||||
if mp.IsEnableAuditLog() {
|
||||
defer func() {
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), p.GetOpMsg(), req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Inode, 0)
|
||||
opMsg := p.GetOpMsg()
|
||||
if req.TxInfo != nil {
|
||||
opMsg = fmt.Sprintf("%s_%s", opMsg, req.TxInfo.TxID)
|
||||
}
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), opMsg, req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Inode, 0)
|
||||
}()
|
||||
}
|
||||
if req.ParentID == req.Inode {
|
||||
@ -193,7 +197,11 @@ func (mp *metaPartition) TxDeleteDentry(req *proto.TxDeleteDentryRequest, p *Pac
|
||||
start := time.Now()
|
||||
if mp.IsEnableAuditLog() {
|
||||
defer func() {
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), p.GetOpMsg(), req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Ino, req.ParentID)
|
||||
opMsg := p.GetOpMsg()
|
||||
if req.TxInfo != nil {
|
||||
opMsg = fmt.Sprintf("%s_%s", opMsg, req.TxInfo.TxID)
|
||||
}
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), opMsg, req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Ino, req.ParentID)
|
||||
}()
|
||||
}
|
||||
txInfo := req.TxInfo.GetCopy()
|
||||
@ -396,7 +404,11 @@ func (mp *metaPartition) TxUpdateDentry(req *proto.TxUpdateDentryRequest, p *Pac
|
||||
start := time.Now()
|
||||
if mp.IsEnableAuditLog() {
|
||||
defer func() {
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), p.GetOpMsg(), req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Inode, req.ParentID)
|
||||
opMsg := p.GetOpMsg()
|
||||
if req.TxInfo != nil {
|
||||
opMsg = fmt.Sprintf("%s_%s", opMsg, req.TxInfo.TxID)
|
||||
}
|
||||
auditlog.LogDentryOp(remoteAddr, mp.GetVolName(), opMsg, req.Name, req.GetFullPath(), err, time.Since(start).Milliseconds(), req.Inode, req.ParentID)
|
||||
}()
|
||||
}
|
||||
if req.ParentID == req.Inode {
|
||||
|
||||
@ -31,9 +31,9 @@ import (
|
||||
const (
|
||||
DefaultTransactionTimeout = 1 // minutes
|
||||
MaxTransactionTimeout = 60 // minutes
|
||||
DefaultTxConflictRetryNum = 10
|
||||
DefaultTxConflictRetryNum = 121
|
||||
MaxTxConflictRetryNum = 100
|
||||
DefaultTxConflictRetryInterval = 20 // ms
|
||||
DefaultTxConflictRetryInterval = 500 // ms
|
||||
MaxTxConflictRetryInterval = 1000 // ms
|
||||
MinTxConflictRetryInterval = 10 // ms
|
||||
DefaultTxDeleteTime = 120
|
||||
|
||||
Loading…
Reference in New Issue
Block a user