Update rocksmq consume slowly log (#12179)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
yukun 2021-11-22 18:51:14 +08:00 committed by GitHub
parent 6e452d1f02
commit 835451e331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -589,6 +589,7 @@ func (rmq *rocksmq) Consume(topicName string, groupName string, n int) ([]Consum
}
lock.Lock()
defer lock.Unlock()
getLockTime := time.Since(start).Milliseconds()
metaKey := constructCurrentID(topicName, groupName)
currentID, err := rmq.kv.Load(metaKey)
@ -669,9 +670,11 @@ func (rmq *rocksmq) Consume(topicName string, groupName string, n int) ([]Consum
}
go rmq.updateAckedInfo(topicName, groupName, consumedIDs)
log.Debug("Rocksmq produce successfully ", zap.String("topic", topicName),
zap.String("groupName", groupName),
zap.Int64("elapsed", time.Since(start).Milliseconds()))
getConsumeTime := time.Since(start).Milliseconds()
if getLockTime > 200 || getConsumeTime > 200 {
log.Warn("rocksmq consume too slowly", zap.String("topic", topicName),
zap.Int64("get lock elapse", getLockTime), zap.Int64("consume elapse", getConsumeTime))
}
return consumerMessage, nil
}