Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Jun 11, 2024
1 parent df3aa38 commit 4011e31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ddl/ddl_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import (
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/cmp"
"github.com/pingcap/tidb/util/logutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"golang.org/x/exp/slices"
"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -232,6 +234,7 @@ func TestCreateViewConcurrently(t *testing.T) {
counter int
)
ddl.OnCreateViewForTest = func(job *model.Job) {
logutil.BgLogger().Info("OnCreateViewForTest", zap.Int("counter", counter), zap.Int64("jobID", job.ID))
counter++
if counter > 1 {
counterErr = fmt.Errorf("create view job should not run concurrently")
Expand All @@ -245,6 +248,7 @@ func TestCreateViewConcurrently(t *testing.T) {

ddl.AfterDelivery2WorkerForTest = func(job *model.Job) {
if job.Type == model.ActionCreateView {
logutil.BgLogger().Info("AfterDelivery2WorkerForTest", zap.Int("counter", counter), zap.Int64("jobID", job.ID))
counter--
}
}
Expand Down
4 changes: 3 additions & 1 deletion ddl/job_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (d *ddl) getJob(sess *session, tp jobType, filter func(*model.Job) (bool, e

func (d *ddl) getGeneralJob(sess *session) (*model.Job, error) {
return d.getJob(sess, general, func(job *model.Job) (bool, error) {
if !d.runningJobs.checkRunnable(job) {
runnable := d.runningJobs.checkRunnable(job)
logutil.BgLogger().Info("getGeneralJob", zap.Bool("runnable", runnable), zap.Reflect("involving_schema_info", job.GetInvolvingSchemaInfo()))
if !runnable {
return false, nil
}
if job.Type == model.ActionDropSchema {
Expand Down

0 comments on commit 4011e31

Please sign in to comment.