Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/ddl/ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ func TestDetectAndUpdateJobVersion(t *testing.T) {
serverInfos := make(map[string]*infosync.ServerInfo, len(versions))
for i, v := range versions {
serverInfos[fmt.Sprintf("node%d", i)] = &infosync.ServerInfo{
ServerVersionInfo: infosync.ServerVersionInfo{Version: v}}
StaticServerInfo: infosync.StaticServerInfo{
ServerVersionInfo: infosync.ServerVersionInfo{Version: v},
}}
}
bytes, err := json.Marshal(serverInfos)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddl/schemaver/syncer_nokit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestSyncJobSchemaVerLoop(t *testing.T) {

// job 4 is matched using WaitVersionSynced
vardef.EnableMDL.Store(true)
serverInfos := map[string]*infosync.ServerInfo{"aa": {ID: "aa", IP: "test", Port: 4000}}
serverInfos := map[string]*infosync.ServerInfo{"aa": {StaticServerInfo: infosync.StaticServerInfo{ID: "aa", IP: "test", Port: 4000}}}
bytes, err := json.Marshal(serverInfos)
require.NoError(t, err)
inTerms := fmt.Sprintf("return(`%s`)", string(bytes))
Expand Down
4 changes: 2 additions & 2 deletions pkg/disttask/importinto/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestLogicalPlan(t *testing.T) {
JobID: 1,
Plan: importer.Plan{},
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
ChunkMap: map[int32][]importer.Chunk{1: {{Path: "gs://test-load/1.csv"}}},
}
bs, err := logicalPlan.ToTaskMeta()
Expand All @@ -64,7 +64,7 @@ func TestToPhysicalPlan(t *testing.T) {
},
},
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
ChunkMap: map[int32][]importer.Chunk{chunkID: {{Path: "gs://test-load/1.csv"}}},
}
planCtx := planner.PlanCtx{
Expand Down
4 changes: 2 additions & 2 deletions pkg/disttask/importinto/scheduler_testkit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestSchedulerExtLocalSort(t *testing.T) {
DisableTiKVImportMode: true,
},
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
ChunkMap: map[int32][]importer.Chunk{1: {{Path: "gs://test-load/1.csv"}}},
}
bs, err := logicalPlan.ToTaskMeta()
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestSchedulerExtGlobalSort(t *testing.T) {
InImportInto: true,
},
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
ChunkMap: map[int32][]importer.Chunk{
1: {{Path: "gs://test-load/1.csv"}},
2: {{Path: "gs://test-load/2.csv"}},
Expand Down
70 changes: 49 additions & 21 deletions pkg/domain/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,23 @@ func TestClosestReplicaReadChecker(t *testing.T) {

mockedAllServerInfos := map[string]*infosync.ServerInfo{
"s1": {
ID: "s1",
Labels: map[string]string{
"zone": "zone1",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s1",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone1",
},
},
},
"s2": {
ID: "s2",
Labels: map[string]string{
"zone": "zone2",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s2",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone2",
},
},
},
}
Expand Down Expand Up @@ -348,33 +356,53 @@ func TestClosestReplicaReadChecker(t *testing.T) {
// partial matches
mockedAllServerInfos = map[string]*infosync.ServerInfo{
"s1": {
ID: "s1",
Labels: map[string]string{
"zone": "zone1",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s1",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone1",
},
},
},
"s2": {
ID: "s2",
Labels: map[string]string{
"zone": "zone2",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s2",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone2",
},
},
},
"s22": {
ID: "s22",
Labels: map[string]string{
"zone": "zone2",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s22",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone2",
},
},
},
"s3": {
ID: "s3",
Labels: map[string]string{
"zone": "zone3",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s3",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone3",
},
},
},
"s4": {
ID: "s4",
Labels: map[string]string{
"zone": "zone4",
StaticServerInfo: infosync.StaticServerInfo{
ID: "s4",
},
DynamicServerInfo: infosync.DynamicServerInfo{
Labels: map[string]string{
"zone": "zone4",
},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/infosync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ go_test(
srcs = ["info_test.go"],
embed = [":infosync"],
flaky = True,
shard_count = 3,
shard_count = 4,
deps = [
"//pkg/ddl/placement",
"//pkg/ddl/util",
Expand Down
Loading