From 99ed2c35525b28f4a61d650c12aff31b0d8389ed Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Mon, 9 Dec 2024 19:55:44 +0800 Subject: [PATCH] fix conflict Signed-off-by: lhy1024 --- server/cluster/cluster.go | 4 ++-- server/server.go | 2 +- tests/server/cluster/cluster_test.go | 8 +++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index 0d3c7530573..4371a2f9ed3 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -2570,6 +2570,6 @@ func (c *RaftCluster) UnsetServiceIndependent(name string) { // GetGlobalTSOAllocator return global tso allocator // It only is used for test. -func (c *RaftCluster) GetGlobalTSOAllocator() (tso.Allocator, error) { - return c.tsoAllocator.GetAllocator(tso.GlobalDCLocation) +func (c *RaftCluster) GetGlobalTSOAllocator() tso.Allocator { + return c.tsoAllocator.GetAllocator() } diff --git a/server/server.go b/server/server.go index 86cc3f135d7..f3eb3cf84df 100644 --- a/server/server.go +++ b/server/server.go @@ -2100,6 +2100,6 @@ func (s *Server) SetClient(client *clientv3.Client) { // GetGlobalTSOAllocator return global tso allocator // It only is used for test. -func (s *Server) GetGlobalTSOAllocator() (tso.Allocator, error) { +func (s *Server) GetGlobalTSOAllocator() tso.Allocator { return s.cluster.GetGlobalTSOAllocator() } diff --git a/tests/server/cluster/cluster_test.go b/tests/server/cluster/cluster_test.go index 3988953102c..f4ef091982d 100644 --- a/tests/server/cluster/cluster_test.go +++ b/tests/server/cluster/cluster_test.go @@ -646,8 +646,7 @@ func TestRaftClusterStartTSOJob(t *testing.T) { leaderServer := tc.GetLeaderServer() re.NotNil(leaderServer) leaderServer.BootstrapCluster() - allocator, err := tc.GetServer(name).GetServer().GetGlobalTSOAllocator() - re.NoError(err) + allocator := tc.GetServer(name).GetServer().GetGlobalTSOAllocator() re.True(allocator.IsInitialize()) tc.Destroy() cancel() @@ -661,8 +660,7 @@ func TestRaftClusterStartTSOJob(t *testing.T) { err = tc.RunInitialServers() re.NoError(err) tc.WaitLeader() - allocator, err = tc.GetServer(name).GetServer().GetGlobalTSOAllocator() - re.NoError(err) + allocator = tc.GetServer(name).GetServer().GetGlobalTSOAllocator() re.False(allocator.IsInitialize()) re.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/raftClusterReturn")) tc.Destroy() @@ -677,7 +675,7 @@ func TestRaftClusterStartTSOJob(t *testing.T) { err = tc.RunInitialServers() re.NoError(err) tc.WaitLeader() - allocator, err = tc.GetServer(name).GetServer().GetGlobalTSOAllocator() + allocator = tc.GetServer(name).GetServer().GetGlobalTSOAllocator() re.NoError(err) re.False(allocator.IsInitialize()) re.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/raftClusterReturn"))