Skip to content

Commit

Permalink
This is an automated cherry-pick of #49699
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
tangenta authored and ti-chi-bot committed Feb 19, 2024
1 parent e51c033 commit f4bd91d
Show file tree
Hide file tree
Showing 11 changed files with 1,823 additions and 29 deletions.
15 changes: 7 additions & 8 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,9 @@ type ddlCtx struct {

*waitSchemaSyncedController
*schemaVersionManager
// recording the running jobs.
runningJobs struct {
sync.RWMutex
ids map[int64]struct{}
}
// It holds the running DDL jobs ID.
runningJobIDs []string

runningJobs *runningJobs

// reorgCtx is used for reorganization.
reorgCtx struct {
sync.RWMutex
Expand Down Expand Up @@ -626,16 +622,19 @@ func newDDL(ctx context.Context, options ...Option) *ddl {
autoidCli: opt.AutoIDClient,
schemaVersionManager: newSchemaVersionManager(),
waitSchemaSyncedController: newWaitSchemaSyncedController(),
runningJobIDs: make([]string, 0, jobRecordCapacity),
runningJobs: newRunningJobs(),
}
ddlCtx.reorgCtx.reorgCtxMap = make(map[int64]*reorgCtx)
ddlCtx.jobCtx.jobCtxMap = make(map[int64]*JobContext)
ddlCtx.mu.hook = opt.Hook
ddlCtx.mu.interceptor = &BaseInterceptor{}
ctx = kv.WithInternalSourceType(ctx, kv.InternalTxnDDL)
ddlCtx.ctx, ddlCtx.cancel = context.WithCancel(ctx)
<<<<<<< HEAD:ddl/ddl.go
ddlCtx.runningJobs.ids = make(map[int64]struct{})
ddlCtx.waiting = atomicutil.NewBool(false)
=======
>>>>>>> 2dfbaa8264f (ddl: set jobs dependency by schema and table name (#49699)):pkg/ddl/ddl.go

d := &ddl{
ddlCtx: ddlCtx,
Expand Down
Loading

0 comments on commit f4bd91d

Please sign in to comment.