Skip to content

Commit

Permalink
Handled feedback. Fixed bugs.
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Shi <[email protected]>
  • Loading branch information
binshi-bing committed Apr 12, 2023
1 parent 612a93f commit 97c21e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/tso/allocator_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ type AllocatorManager struct {

ctx context.Context
cancel context.CancelFunc
// kgID is the keyspace group id
// kgID is the keyspace group ID
kgID uint32
// member is for election use
member ElectionMember
Expand Down
11 changes: 7 additions & 4 deletions pkg/tso/keyspace_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (s *state) deinitialize() {
}
wg.Wait()

log.Info("All keyspace groups closed")
log.Info("all keyspace groups closed")
}

// getAllocatorManager returns the AllocatorManager of the given keyspace group
Expand All @@ -108,9 +108,9 @@ func (s *state) getAMWithMembershipCheck(
defer s.RUnlock()

if am := s.ams[keyspaceGroupID]; am != nil {
ksg := s.kgs[keyspaceGroupID]
if ksg != nil {
if _, ok := ksg.KeyspaceLookupTable[keyspaceID]; ok {
kg := s.kgs[keyspaceGroupID]
if kg != nil {
if _, ok := kg.KeyspaceLookupTable[keyspaceID]; ok {
return am, keyspaceGroupID, nil
}
}
Expand Down Expand Up @@ -595,6 +595,9 @@ func (kgm *KeyspaceGroupManager) updateKeyspaceGroupMembership(

// deleteKeyspaceGroup deletes the given keyspace group.
func (kgm *KeyspaceGroupManager) deleteKeyspaceGroup(groupID uint32) {
kgm.Lock()
defer kgm.Unlock()

kg := kgm.kgs[groupID]
if kg != nil {
for _, kid := range kg.Keyspaces {
Expand Down

0 comments on commit 97c21e3

Please sign in to comment.