Skip to content

ddl: ADMIN ALTER DDL JOBS silently no-op in txn backfill mode on release-8.5 (regression of #63201 fix) #70138

Description

@jebter

Bug Report

Affected branch: release-8.5 only (introduced by the DXF dynamic-parameter backport #64930, commit e7f04fa; master is NOT affected). Found during a v8.5.4..v8.5.6 PR-by-PR review.

What happened

#63674 (master #63605, closing #63201) added reorgInfo.UpdateConfigFromSysTbl(ctx) to the worker-adjustment ticker in writePhysicalTableRecord, so that ADMIN ALTER DDL JOBS ... THREAD/BATCH_SIZE takes effect on a running txn-mode reorg by refreshing ReorgMeta atomics from mysql.tidb_ddl_job every 2s.

The #64930 backport dropped exactly that line during conflict resolution (-reorgInfo.UpdateConfigFromSysTbl(ctx) in pkg/ddl/backfilling.go). Since then the ticker only compares against the in-memory ReorgMeta — which nothing updates — so the target worker count forever equals the job-start value.

master never lost the line (still present at pkg/ddl/backfilling.go:1110); on release-8.5 only the local-ingest ticker (backfilling.go:886) still calls it. DXF (modifyTaskParamLoop) and local-ingest paths are unaffected.

Impact

With tidb_enable_dist_task=off and tidb_ddl_enable_fast_reorg=off (txn backfill mode), admin alter ddl jobs N thread = X is accepted and persisted but silently has no effect on the running backfill. New parameters only take effect after an owner switch / job restart. No wrong results.

Reproduction (verified end-to-end on a v8.5.7 tikv cluster, 8.4M-row table)

  • txn mode (dist_task=off, fast_reorg=off): job accepted admin alter ddl jobs 117 thread = 32 (job COMMENTS show txn, thread=32), ran 3m33s (~100 ticker ticks) — zero adjust ddl job config success log lines.
  • local ingest control (fast_reorg=on): same alter — adjust ddl job config success appears within 2-5s (backfilling.go:901, workers tuned to 16/32).

This proves the alter itself is effective and the logging works; only the txn path never refreshes the config.

Note: the existing regression test TestFixAdminAlterDDLJobs (tests/realtikvtest/addindextest4/integration_test.go, the mockUpdateColumnWorkerStuck/mockAddIndexTxnWorkerStuck cases) should catch this — worth checking its CI status on release-8.5.

Suggested fix

Restore reorgInfo.UpdateConfigFromSysTbl(ctx) as the first statement of the case <-ticker.C: branch in writePhysicalTableRecord (pkg/ddl/backfilling.go), aligning with master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-8.5This bug affects the 8.5.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.type/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions