From 17be9d33738be663a69e90ec169adfdc1369f94f Mon Sep 17 00:00:00 2001 From: HunDunDM Date: Sat, 11 Feb 2023 04:34:50 +0800 Subject: [PATCH] cluster: no more redundant etcd writes when SetMinResolvedTS is called Signed-off-by: HunDunDM --- server/cluster/cluster.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index 411a37a0443..51389e48e93 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -2326,11 +2326,9 @@ func (c *RaftCluster) SetMinResolvedTS(storeID, minResolvedTS uint64) error { return errs.ErrStoreNotFound.FastGenByArgs(storeID) } - newStore := store.Clone( - core.SetMinResolvedTS(minResolvedTS), - ) - - return c.putStoreLocked(newStore) + newStore := store.Clone(core.SetMinResolvedTS(minResolvedTS)) + c.core.PutStore(newStore) + return nil } func (c *RaftCluster) checkAndUpdateMinResolvedTS() (uint64, bool) {