Optimize updatePageInfo in rocksmq (#11711)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
pull/11902/head
yukun 2021-11-16 17:13:10 +08:00 committed by GitHub
parent da9228ab37
commit 79fc84f3db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 12 deletions

View File

@ -519,23 +519,14 @@ func (rmq *rocksmq) updatePageInfo(topicName string, msgIDs []UniqueID, msgSizes
if err != nil {
return err
}
// Update message size to 0
err = rmq.kv.Save(msgSizeKey, strconv.FormatInt(0, 10))
if err != nil {
return err
}
curMsgSize = 0
} else {
curMsgSize += msgSize
// Update message size to current message size
err := rmq.kv.Save(msgSizeKey, strconv.FormatInt(curMsgSize, 10))
if err != nil {
return err
}
}
}
return nil
// Update message size to current message size
err = rmq.kv.Save(msgSizeKey, strconv.FormatInt(curMsgSize, 10))
return err
}
// Consume steps: