Handle error in topic creation of rocksmq (#15922)

Reopen for: #14429

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
XuanYang-cn 2022-03-09 15:47:59 +08:00 committed by GitHub
parent 6513be5c44
commit c2fe12bc97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,7 +319,9 @@ func (rmq *rocksmq) CreateTopic(topicName string) error {
// Initialize topic id to its creating time, we don't really use it for now
nowTs := strconv.FormatInt(time.Now().Unix(), 10)
kvs[topicIDKey] = nowTs
rmq.kv.MultiSave(kvs)
if err = rmq.kv.MultiSave(kvs); err != nil {
return retry.Unrecoverable(err)
}
rmq.retentionInfo.mutex.Lock()
defer rmq.retentionInfo.mutex.Unlock()