From 0f736a4b163589115f38541d9258a9d95af7ee5d Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Mon, 14 Jul 2025 19:32:50 +0800 Subject: [PATCH] enhance: Save meta with txn limit (#43263) (#43288) pr: #43263 Signed-off-by: sunby --- internal/metastore/kv/rootcoord/suffix_snapshot.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/metastore/kv/rootcoord/suffix_snapshot.go b/internal/metastore/kv/rootcoord/suffix_snapshot.go index 756ce3c6ec..068b478426 100644 --- a/internal/metastore/kv/rootcoord/suffix_snapshot.go +++ b/internal/metastore/kv/rootcoord/suffix_snapshot.go @@ -543,8 +543,9 @@ func (ss *SuffixSnapshot) MultiSaveAndRemove(ctx context.Context, saves map[stri updateList = append(updateList, removal) } - // multi save execute map; if succeeds, update ts in the update list - err = ss.MetaKv.MultiSave(ctx, execute) + err = etcd.SaveByBatchWithLimit(execute, util.MaxEtcdTxnNum, func(partialKvs map[string]string) error { + return ss.MetaKv.MultiSave(ctx, partialKvs) + }) if err == nil { for _, key := range updateList { ss.lastestTS[key] = ts