Skip to content

Commit

Permalink
Set up tsoAllocatorLoop inside NewAllocatorManager
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Apr 4, 2023
1 parent eb8bf64 commit 1546758
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/tso/allocator_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ func NewAllocatorManager(

// Set up the Global TSO Allocator here, it will be initialized once the member campaigns leader successfully.
am.SetUpGlobalAllocator(am.ctx, am.member.GetLeadership(), startGlobalLeaderLoop)
am.svcLoopWG.Add(1)
go am.tsoAllocatorLoop()

return am
}
Expand All @@ -252,9 +254,6 @@ func (am *AllocatorManager) SetUpGlobalAllocator(ctx context.Context, leadership
leadership: leadership,
allocator: allocator,
}

am.svcLoopWG.Add(1)
go am.tsoAllocatorLoop()
}

// setUpLocalAllocator is used to set up an allocator, which will initialize the allocator and put it into allocator daemon.
Expand Down Expand Up @@ -282,7 +281,6 @@ func (am *AllocatorManager) setUpLocalAllocator(parentCtx context.Context, dcLoc
}

// tsoAllocatorLoop is used to run the TSO Allocator updating daemon.
// tso service starts the loop here, but pd starts its own loop.
func (am *AllocatorManager) tsoAllocatorLoop() {
defer logutil.LogPanic()
defer am.svcLoopWG.Done()
Expand Down

0 comments on commit 1546758

Please sign in to comment.