From 305b5505bcc7ad142fdb3934d21389aa324fb9f5 Mon Sep 17 00:00:00 2001 From: nolouch Date: Tue, 21 Nov 2023 17:20:10 +0800 Subject: [PATCH] fix Signed-off-by: nolouch --- server/cluster/cluster.go | 2 +- tests/server/api/api_test.go | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index 49a55c4cc9c..d1ebdfe5b15 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -1756,7 +1756,7 @@ func (c *RaftCluster) checkStores() { if err := c.ReadyToServe(storeID); err != nil { log.Error("change store to serving failed", zap.Stringer("store", store.GetMeta()), - zap.Int("region-count", c.GetTotalRegionCount()), + zap.Int("region-count", c.GetRegionCount()), errs.ZapError(err)) } } else if c.IsPrepared() { diff --git a/tests/server/api/api_test.go b/tests/server/api/api_test.go index 340b5bff27f..ee0d41c481e 100644 --- a/tests/server/api/api_test.go +++ b/tests/server/api/api_test.go @@ -901,11 +901,7 @@ func TestPreparingProgress(t *testing.T) { pdctl.MustPutStore(re, leader.GetServer(), store) } for i := 0; i < 100; i++ { -<<<<<<< HEAD - pdctl.MustPutRegion(re, cluster, uint64(i+1), uint64(i)%3+1, []byte(fmt.Sprintf("p%d", i)), []byte(fmt.Sprintf("%d", i+1)), core.SetApproximateSize(10)) -======= - tests.MustPutRegion(re, cluster, uint64(i+1), uint64(i)%3+1, []byte(fmt.Sprintf("%20d", i)), []byte(fmt.Sprintf("%20d", i+1)), core.SetApproximateSize(10)) ->>>>>>> d651c6b91 (core: batch get region size (#7252)) + pdctl.MustPutRegion(re, cluster, uint64(i+1), uint64(i)%3+1, []byte(fmt.Sprintf("%20d", i)), []byte(fmt.Sprintf("%20d", i+1)), core.SetApproximateSize(10)) } // no store preparing output := sendRequest(re, leader.GetAddr()+"/pd/api/v1/stores/progress?action=preparing", http.MethodGet, http.StatusNotFound) @@ -932,13 +928,8 @@ func TestPreparingProgress(t *testing.T) { re.Equal(math.MaxFloat64, p.LeftSeconds) // update size -<<<<<<< HEAD - pdctl.MustPutRegion(re, cluster, 1000, 4, []byte(fmt.Sprintf("%d", 1000)), []byte(fmt.Sprintf("%d", 1001)), core.SetApproximateSize(10)) - pdctl.MustPutRegion(re, cluster, 1001, 5, []byte(fmt.Sprintf("%d", 1001)), []byte(fmt.Sprintf("%d", 1002)), core.SetApproximateSize(40)) -======= - tests.MustPutRegion(re, cluster, 1000, 4, []byte(fmt.Sprintf("%20d", 1000)), []byte(fmt.Sprintf("%20d", 1001)), core.SetApproximateSize(10)) - tests.MustPutRegion(re, cluster, 1001, 5, []byte(fmt.Sprintf("%20d", 1001)), []byte(fmt.Sprintf("%20d", 1002)), core.SetApproximateSize(40)) ->>>>>>> d651c6b91 (core: batch get region size (#7252)) + pdctl.MustPutRegion(re, cluster, 1000, 4, []byte(fmt.Sprintf("%20d", 1000)), []byte(fmt.Sprintf("%20d", 1001)), core.SetApproximateSize(10)) + pdctl.MustPutRegion(re, cluster, 1001, 5, []byte(fmt.Sprintf("%20d", 1001)), []byte(fmt.Sprintf("%20d", 1002)), core.SetApproximateSize(40)) time.Sleep(2 * time.Second) output = sendRequest(re, leader.GetAddr()+"/pd/api/v1/stores/progress?action=preparing", http.MethodGet, http.StatusOK) re.NoError(json.Unmarshal(output, &p))