Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <[email protected]>
  • Loading branch information
CabinfeverB committed Nov 28, 2023
1 parent 786e6d7 commit 73064fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/syncer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func (s *RegionSyncer) syncRegion(ctx context.Context, conn *grpc.ClientConn) (C

var regionGuide = core.GenerateRegionGuideFunc(false)

// IsRunningAsClient returns whether the region syncer client is running.
func (s *RegionSyncer) IsRunningAsClient() bool {
// IsRunning returns whether the region syncer client is running.
func (s *RegionSyncer) IsRunning() bool {
return s.streamingRunning.Load() && s.historyLoaded.Load()
}

Expand Down Expand Up @@ -168,7 +168,6 @@ func (s *RegionSyncer) StartSyncWithLeader(addr string) {
break
}
if s.history.GetNextIndex() != resp.GetStartIndex() {
log.Panic("test")
log.Warn("server sync index not match the leader",
zap.String("server", s.server.Name()),
zap.Uint64("own", s.history.GetNextIndex()),
Expand Down
6 changes: 3 additions & 3 deletions tests/server/region_syncer/region_syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func TestRegionSyncer(t *testing.T) {
followerServer := cluster.GetServer(cluster.GetFollower())

testutil.Eventually(re, func() bool {
return !followerServer.GetServer().DirectlyGetRaftCluster().GetRegionSyncer().IsRunningAsClient()
return !followerServer.GetServer().DirectlyGetRaftCluster().GetRegionSyncer().IsRunning()
})
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/syncer/disableClientStreaming"))
re.True(cluster.WaitRegionSyncerClientsReady(2))
testutil.Eventually(re, func() bool {
return followerServer.GetServer().DirectlyGetRaftCluster().GetRegionSyncer().IsRunningAsClient()
return followerServer.GetServer().DirectlyGetRaftCluster().GetRegionSyncer().IsRunning()
})

regionLen := 110
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestRegionSyncer(t *testing.T) {
cluster.WaitLeader()
leaderServer = cluster.GetLeaderServer()
testutil.Eventually(re, func() bool {
return !leaderServer.GetServer().GetRaftCluster().GetRegionSyncer().IsRunningAsClient()
return !leaderServer.GetServer().GetRaftCluster().GetRegionSyncer().IsRunning()
})
re.NotNil(leaderServer)
loadRegions := leaderServer.GetServer().GetRaftCluster().GetRegions()
Expand Down

0 comments on commit 73064fc

Please sign in to comment.