@@ -211,8 +211,8 @@ type backfillCtx struct {
211
211
}
212
212
213
213
func newBackfillCtx (ctx * ddlCtx , id int , sessCtx sessionctx.Context , reorgTp model.ReorgType ,
214
- schemaName string , tbl table.Table ) * backfillCtx {
215
- if id == 0 {
214
+ schemaName string , tbl table.Table , isDistributed bool ) * backfillCtx {
215
+ if isDistributed {
216
216
id = int (backfillContextID .Add (1 ))
217
217
}
218
218
return & backfillCtx {
@@ -912,7 +912,7 @@ func (b *backfillScheduler) adjustWorkerSize() error {
912
912
)
913
913
switch b .tp {
914
914
case typeAddIndexWorker :
915
- backfillCtx := newBackfillCtx (reorgInfo .d , i , sessCtx , reorgInfo .ReorgMeta .ReorgTp , job .SchemaName , b .tbl )
915
+ backfillCtx := newBackfillCtx (reorgInfo .d , i , sessCtx , reorgInfo .ReorgMeta .ReorgTp , job .SchemaName , b .tbl , false )
916
916
idxWorker , err := newAddIndexWorker (b .decodeColMap , b .tbl , backfillCtx ,
917
917
jc , job .ID , reorgInfo .currElement .ID , reorgInfo .currElement .TypeKey )
918
918
if err != nil {
@@ -925,7 +925,7 @@ func (b *backfillScheduler) adjustWorkerSize() error {
925
925
runner = newBackfillWorker (jc .ddlJobCtx , idxWorker )
926
926
worker = idxWorker
927
927
case typeAddIndexMergeTmpWorker :
928
- backfillCtx := newBackfillCtx (reorgInfo .d , i , sessCtx , reorgInfo .ReorgMeta .ReorgTp , job .SchemaName , b .tbl )
928
+ backfillCtx := newBackfillCtx (reorgInfo .d , i , sessCtx , reorgInfo .ReorgMeta .ReorgTp , job .SchemaName , b .tbl , false )
929
929
tmpIdxWorker := newMergeTempIndexWorker (backfillCtx , i , b .tbl , reorgInfo .currElement .ID , jc )
930
930
runner = newBackfillWorker (jc .ddlJobCtx , tmpIdxWorker )
931
931
worker = tmpIdxWorker
0 commit comments