fix: may exceed max tnx in etcd operations (#36773)

issue: #36772
pr: #36775

Signed-off-by: jaime <yun.zhang@zilliz.com>
This commit is contained in:
jaime 2024-10-11 19:51:22 +08:00 committed by GitHub
parent a57626afa0
commit 4110f35f1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -595,7 +595,7 @@ func (ss *SuffixSnapshot) batchRemoveExpiredKvs(keyGroup []string, originalKey s
// to protect txn finished with ascend order, reverse the latest kv with tombstone to tail of array
sort.Strings(keyGroup)
removeFn := func(partialKeys []string) error {
return ss.MetaKv.MultiRemove(keyGroup)
return ss.MetaKv.MultiRemove(partialKeys)
}
return etcd.RemoveByBatchWithLimit(keyGroup, util.MaxEtcdTxnNum, removeFn)
}