Skip to content

Commit

Permalink
Merge branch 'master' into fix_test
Browse files Browse the repository at this point in the history
  • Loading branch information
HuSharp authored Jul 11, 2023
2 parents 8da8967 + e18b9be commit 6abbcbb
Show file tree
Hide file tree
Showing 37 changed files with 1,259 additions and 855 deletions.
11 changes: 3 additions & 8 deletions pkg/keyspace/tso_keyspace_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package keyspace
import (
"context"
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -1123,14 +1122,10 @@ func (m *GroupManager) GetKeyspaceGroupPrimaryByID(id uint32) (string, error) {
return "", ErrKeyspaceGroupNotExists(id)
}

// default keyspace group: "/ms/{cluster_id}/tso/00000/primary".
// non-default keyspace group: "/ms/{cluster_id}/tso/keyspace_groups/election/{group}/primary".
path := fmt.Sprintf("/ms/%d/tso/00000/primary", m.clusterID)
if id != utils.DefaultKeyspaceGroupID {
path = fmt.Sprintf("/ms/%d/tso/keyspace_groups/election/%05d/primary", m.clusterID, id)
}
rootPath := endpoint.TSOSvcRootPath(m.clusterID)
primaryPath := endpoint.KeyspaceGroupPrimaryPath(rootPath, id)
leader := &tsopb.Participant{}
ok, _, err := etcdutil.GetProtoMsgWithModRev(m.client, path, leader)
ok, _, err := etcdutil.GetProtoMsgWithModRev(m.client, primaryPath, leader)
if err != nil {
return "", err
}
Expand Down
Loading

0 comments on commit 6abbcbb

Please sign in to comment.