-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: fix alter table exchange partition does not work if table has tiflash replica #17940
Changes from 1 commit
70f6354
57af241
af97469
adef48e
1a7f599
11809d0
c8bc050
5a32fe4
35941aa
7468924
64fd709
cb88c18
71cf840
a902cdc
a228468
9ff0790
dda9d75
32c6285
899033f
f4f5b38
a38b5e0
3cec6f2
53f4f73
101c673
a1ca360
40db78a
c559f12
f9fdd0c
c979e69
c096c8c
4130a9a
0ffd1ab
488cb5f
b5cfdd3
fac04c1
be92bb3
3f38e2b
d9bc6fa
ea173bf
57aeb95
5a29bdd
aa8da8e
ebce341
65f4c64
5a46b18
ec51f5e
a93fe24
95b2554
134c55d
d724823
894b7e5
40729a1
6ea633d
d9b98c0
b194f11
7807380
4769d3b
325d596
33e0c36
6eeb3fd
b46a6bb
85d71c0
a4d0161
6c1d63a
b5b6824
999b0d9
2cf5d03
52676f8
6bc1a4a
9cd7caa
771e4dd
f2ab275
dc8abd3
44f6018
3ec7b7a
f3fc2e7
273e911
ffe48c0
bc77a30
db68d2a
437aab9
f7bd233
62b7e27
0acdba0
134109d
aa789e8
72438b2
6a31a34
46115cb
ee85e37
0858658
2b74ae4
30b726a
245cd92
ce74f1b
4dafc9b
f838184
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -812,6 +812,19 @@ func (w *worker) onExchangeTablePartition(d *ddlCtx, t *meta.Meta, job *model.Jo | |
// exchange table meta id | ||
partDef.ID = nt.ID | ||
|
||
// Clear the tiflash replica available status. | ||
if pt.TiFlashReplica != nil { | ||
pt.TiFlashReplica.Available = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more question: is it possible that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get that It seem that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TiFlash does not support exchange partition when #17149 is merged, and it has supported now, so you can safely delete related code, but take care of my last question, if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hava a question about how to change a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with TiDB, if |
||
nt.TiFlashReplica.Available = false | ||
// Set partition replica become unavailable. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done PTAL |
||
for i, id := range pt.TiFlashReplica.AvailablePartitionIDs { | ||
if id == tempID { | ||
pt.TiFlashReplica.AvailablePartitionIDs[i] = partDef.ID | ||
break | ||
} | ||
} | ||
} | ||
|
||
err = t.UpdateTable(ptSchemaID, pt) | ||
if err != nil { | ||
job.State = model.JobStateCancelled | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remove this comment since the code no longer clear the tiflash replica available status