Skip to content

Commit dc68d59

Browse files
committed
This is an automated cherry-pick of pingcap#58473
Signed-off-by: ti-chi-bot <[email protected]> Revert "This is an automated cherry-pick of pingcap#58473" This reverts commit bf5fda5. resolve conflict Signed-off-by: you06 <[email protected]> fix build Signed-off-by: you06 <[email protected]>
1 parent e5ec1ed commit dc68d59

File tree

9 files changed

+345
-116
lines changed

9 files changed

+345
-116
lines changed

pkg/disttask/importinto/dispatcher_testkit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestDispatcherExtLocalSort(t *testing.T) {
6969
DisableTiKVImportMode: true,
7070
},
7171
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
72-
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
72+
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
7373
ChunkMap: map[int32][]importinto.Chunk{1: {{Path: "gs://test-load/1.csv"}}},
7474
}
7575
bs, err := logicalPlan.ToTaskMeta()
@@ -211,7 +211,7 @@ func TestDispatcherExtGlobalSort(t *testing.T) {
211211
InImportInto: true,
212212
},
213213
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
214-
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
214+
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
215215
ChunkMap: map[int32][]importinto.Chunk{
216216
1: {{Path: "gs://test-load/1.csv"}},
217217
2: {{Path: "gs://test-load/2.csv"}},

pkg/disttask/importinto/planner_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestLogicalPlan(t *testing.T) {
3636
JobID: 1,
3737
Plan: importer.Plan{},
3838
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
39-
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
39+
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
4040
ChunkMap: map[int32][]Chunk{1: {{Path: "gs://test-load/1.csv"}}},
4141
}
4242
bs, err := logicalPlan.ToTaskMeta()
@@ -57,7 +57,7 @@ func TestToPhysicalPlan(t *testing.T) {
5757
},
5858
},
5959
Stmt: `IMPORT INTO db.tb FROM 'gs://test-load/*.csv?endpoint=xxx'`,
60-
EligibleInstances: []*infosync.ServerInfo{{ID: "1"}},
60+
EligibleInstances: []*infosync.ServerInfo{{StaticServerInfo: infosync.StaticServerInfo{ID: "1"}}},
6161
ChunkMap: map[int32][]Chunk{chunkID: {{Path: "gs://test-load/1.csv"}}},
6262
}
6363
planCtx := planner.PlanCtx{

pkg/domain/domain_test.go

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,23 @@ func TestClosestReplicaReadChecker(t *testing.T) {
271271

272272
mockedAllServerInfos := map[string]*infosync.ServerInfo{
273273
"s1": {
274-
ID: "s1",
275-
Labels: map[string]string{
276-
"zone": "zone1",
274+
StaticServerInfo: infosync.StaticServerInfo{
275+
ID: "s1",
276+
},
277+
DynamicServerInfo: infosync.DynamicServerInfo{
278+
Labels: map[string]string{
279+
"zone": "zone1",
280+
},
277281
},
278282
},
279283
"s2": {
280-
ID: "s2",
281-
Labels: map[string]string{
282-
"zone": "zone2",
284+
StaticServerInfo: infosync.StaticServerInfo{
285+
ID: "s2",
286+
},
287+
DynamicServerInfo: infosync.DynamicServerInfo{
288+
Labels: map[string]string{
289+
"zone": "zone2",
290+
},
283291
},
284292
},
285293
}
@@ -345,33 +353,53 @@ func TestClosestReplicaReadChecker(t *testing.T) {
345353
// partial matches
346354
mockedAllServerInfos = map[string]*infosync.ServerInfo{
347355
"s1": {
348-
ID: "s1",
349-
Labels: map[string]string{
350-
"zone": "zone1",
356+
StaticServerInfo: infosync.StaticServerInfo{
357+
ID: "s1",
358+
},
359+
DynamicServerInfo: infosync.DynamicServerInfo{
360+
Labels: map[string]string{
361+
"zone": "zone1",
362+
},
351363
},
352364
},
353365
"s2": {
354-
ID: "s2",
355-
Labels: map[string]string{
356-
"zone": "zone2",
366+
StaticServerInfo: infosync.StaticServerInfo{
367+
ID: "s2",
368+
},
369+
DynamicServerInfo: infosync.DynamicServerInfo{
370+
Labels: map[string]string{
371+
"zone": "zone2",
372+
},
357373
},
358374
},
359375
"s22": {
360-
ID: "s22",
361-
Labels: map[string]string{
362-
"zone": "zone2",
376+
StaticServerInfo: infosync.StaticServerInfo{
377+
ID: "s22",
378+
},
379+
DynamicServerInfo: infosync.DynamicServerInfo{
380+
Labels: map[string]string{
381+
"zone": "zone2",
382+
},
363383
},
364384
},
365385
"s3": {
366-
ID: "s3",
367-
Labels: map[string]string{
368-
"zone": "zone3",
386+
StaticServerInfo: infosync.StaticServerInfo{
387+
ID: "s3",
388+
},
389+
DynamicServerInfo: infosync.DynamicServerInfo{
390+
Labels: map[string]string{
391+
"zone": "zone3",
392+
},
369393
},
370394
},
371395
"s4": {
372-
ID: "s4",
373-
Labels: map[string]string{
374-
"zone": "zone4",
396+
StaticServerInfo: infosync.StaticServerInfo{
397+
ID: "s4",
398+
},
399+
DynamicServerInfo: infosync.DynamicServerInfo{
400+
Labels: map[string]string{
401+
"zone": "zone4",
402+
},
375403
},
376404
},
377405
}

pkg/domain/infosync/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ go_test(
6363
srcs = ["info_test.go"],
6464
embed = [":infosync"],
6565
flaky = True,
66-
shard_count = 5,
66+
shard_count = 6,
6767
deps = [
6868
"//pkg/ddl/placement",
6969
"//pkg/ddl/util",

0 commit comments

Comments
 (0)