Skip to content

Commit

Permalink
run ci
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Jun 9, 2023
1 parent f4c5900 commit 1b68fa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/keyspace/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (manager *Manager) Bootstrap() error {
if err != nil && err != ErrKeyspaceExists {
return err
}
log.Info("save keyspace group in keyspace bootstrap for alloc node test")
if err := manager.kgm.UpdateKeyspaceForGroup(endpoint.Basic, config[TSOKeyspaceGroupIDKey], defaultKeyspaceMeta.GetId(), opAdd); err != nil {
return err
}
Expand All @@ -164,6 +165,7 @@ func (manager *Manager) Bootstrap() error {
if err != nil && err != ErrKeyspaceExists {
return err
}
log.Info("save keyspace group in keyspace bootstrap for alloc node test")
if err := manager.kgm.UpdateKeyspaceForGroup(endpoint.Basic, config[TSOKeyspaceGroupIDKey], keyspace.GetId(), opAdd); err != nil {
return err
}
Expand Down Expand Up @@ -226,6 +228,7 @@ func (manager *Manager) CreateKeyspace(request *CreateKeyspaceRequest) (*keyspac
)
return nil, err
}
log.Info("save keyspace group in keyspace bootstrap for alloc node test")
if err := manager.kgm.UpdateKeyspaceForGroup(userKind, config[TSOKeyspaceGroupIDKey], keyspace.GetId(), opAdd); err != nil {
return nil, err
}
Expand Down Expand Up @@ -472,13 +475,15 @@ func (manager *Manager) UpdateKeyspaceConfig(name string, mutations []*Mutation)
newID := newConfig[TSOKeyspaceGroupIDKey]
needUpdate := oldUserKind != newUserKind || oldID != newID
if needUpdate {
log.Info("save keyspace group in keyspace UpdateKeyspaceGroup for alloc node test")
if err := manager.kgm.UpdateKeyspaceGroup(oldID, newID, oldUserKind, newUserKind, meta.GetId()); err != nil {
return err
}
}
// Save the updated keyspace meta.
if err := manager.store.SaveKeyspaceMeta(txn, meta); err != nil {
if needUpdate {
log.Info("save keyspace group in keyspace UpdateKeyspaceGroup for alloc node test")
if err := manager.kgm.UpdateKeyspaceGroup(newID, oldID, newUserKind, oldUserKind, meta.GetId()); err != nil {
log.Error("failed to revert keyspace group", zap.Error(err))
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/keyspace/tso_keyspace_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (m *GroupManager) Bootstrap() error {
defer m.Unlock()

// Ignore the error if default keyspace group already exists in the storage (e.g. PD restart/recover).
log.Info("save keyspace group in Bootstrap for alloc node test")
err := m.saveKeyspaceGroups([]*endpoint.KeyspaceGroup{defaultKeyspaceGroup}, false)
if err != nil && err != ErrKeyspaceGroupExists {
return err
Expand Down Expand Up @@ -249,6 +250,7 @@ func (m *GroupManager) initTSONodesWatcher(client *clientv3.Client, clusterID ui
func (m *GroupManager) CreateKeyspaceGroups(keyspaceGroups []*endpoint.KeyspaceGroup) error {
m.Lock()
defer m.Unlock()
log.Info("save keyspace group in CreateKeyspaceGroups for alloc node test")
if err := m.saveKeyspaceGroups(keyspaceGroups, false); err != nil {
return err
}
Expand Down Expand Up @@ -435,6 +437,7 @@ func (m *GroupManager) updateKeyspaceForGroupLocked(userKind endpoint.UserKind,
}

if changed {
log.Info("save keyspace group in updateKeyspaceForGroupLocked for alloc node test")
if err := m.saveKeyspaceGroups([]*endpoint.KeyspaceGroup{kg}, true); err != nil {
return err
}
Expand Down Expand Up @@ -484,7 +487,7 @@ func (m *GroupManager) UpdateKeyspaceGroup(oldGroupID, newGroupID string, oldUse
if lenOfOldKeyspaces != len(oldKG.Keyspaces) {
updateOld = true
}

log.Info("save keyspace group in UpdateKeyspaceGroup for alloc node test")
if err := m.saveKeyspaceGroups([]*endpoint.KeyspaceGroup{oldKG, newKG}, true); err != nil {
return err
}
Expand Down

0 comments on commit 1b68fa8

Please sign in to comment.