Delete messages before delete meta data in rocksmq retention (#9694)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
pull/9743/head
yukun 2021-10-12 19:09:22 +08:00 committed by GitHub
parent de14446286
commit cdeb64d90a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -517,11 +517,17 @@ func (ri *retentionInfo) newExpiredCleanUp(topic string) error {
newAckedSize := totalAckedSize - deletedAckedSize
writeBatch.Put([]byte(ackedSizeKey), []byte(strconv.FormatInt(newAckedSize, 10)))
err = DeleteMessages(ri.db, topic, startID, endID)
if err != nil {
return err
}
writeOpts := gorocksdb.NewDefaultWriteOptions()
defer writeOpts.Destroy()
ri.kv.DB.Write(writeOpts, writeBatch)
return DeleteMessages(ri.db, topic, startID, endID)
return nil
}
/*