Skip to content

Commit

Permalink
Address the comments
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed May 6, 2023
1 parent 7eff02e commit 05adbaa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/keyspace/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type Manager struct {
config Config
// kgm is the keyspace group manager of the server.
kgm *GroupManager
// nextPatrolStartID is the last start id of keyspace assignment patrol.
// nextPatrolStartID is the next start id of keyspace assignment patrol.
nextPatrolStartID uint32
}

Expand Down Expand Up @@ -624,13 +624,10 @@ func (manager *Manager) PatrolKeyspaceAssignment() error {
manager.metaLock.Lock(ks.Id)
if ks.Config == nil {
ks.Config = make(map[string]string, 1)
} else {
} else if _, ok := ks.Config[TSOKeyspaceGroupIDKey]; ok {
// If the keyspace already has a group ID, skip it.
_, ok := ks.Config[TSOKeyspaceGroupIDKey]
if ok {
manager.metaLock.Unlock(ks.Id)
continue
}
manager.metaLock.Unlock(ks.Id)
continue
}
// Unlock the keyspace meta lock after the whole txn.
keyspaceIDsToUnlock = append(keyspaceIDsToUnlock, ks.Id)
Expand Down

0 comments on commit 05adbaa

Please sign in to comment.