Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Dec 9, 2024
1 parent ce3d7e7 commit 99ed2c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
8 changes: 3 additions & 5 deletions tests/server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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"))
Expand Down

0 comments on commit 99ed2c3

Please sign in to comment.