Skip to content

Commit

Permalink
ddl: remove useless logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Feb 7, 2023
1 parent a1af116 commit d456da2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions ddl/db_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3142,7 +3142,6 @@ func testPartitionAddIndexOrPK(t *testing.T, tk *testkit.TestKit, key string) {
partition p6 values less than (2012),
partition p7 values less than (2018)
);`)
logutil.BgLogger().Warn("xxx$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 111")
testPartitionAddIndex(tk, t, key)

// test hash partition table.
Expand All @@ -3152,7 +3151,6 @@ func testPartitionAddIndexOrPK(t *testing.T, tk *testkit.TestKit, key string) {
id int not null,
hired date not null
) partition by hash( year(hired) ) partitions 4;`)
logutil.BgLogger().Warn("xxx$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 222")
testPartitionAddIndex(tk, t, key)

// Test hash partition for pr 10475.
Expand Down Expand Up @@ -3200,7 +3198,6 @@ func testPartitionAddIndex(tk *testkit.TestKit, t *testing.T, key string) {
tk.MustExec(dml)

tk.MustExec(fmt.Sprintf("alter table partition_add_idx add %s idx1 (hired)", key))
logutil.BgLogger().Warn("xxx@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
tk.MustExec("alter table partition_add_idx add index idx2 (id, hired)")
ctx := tk.Session()
is := domain.GetDomain(ctx).InfoSchema()
Expand Down
3 changes: 1 addition & 2 deletions ddl/dist_backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ func GetTasks(d *ddlCtx, sess *session, tbl table.Table, runningJobID int64, con
// TODO: At present, only add index is processed. In the future, different elements need to be distinguished.
var err error
var pTblID int64
bJobs := make([]*BackfillJob, 0, concurrency)
for i := 0; i < retrySQLTimes; i++ {
bJobs, err = GetAndMarkBackfillJobsForOneEle(sess, concurrency, runningJobID, d.uuid, pTblID, InstanceLease)
bJobs, err := GetAndMarkBackfillJobsForOneEle(sess, concurrency, runningJobID, d.uuid, pTblID, InstanceLease)
if err != nil {
// TODO: add test: if all tidbs can't get the unmark backfill job(a tidb mark a backfill job, other tidbs returned, then the tidb can't handle this job.)
if dbterror.ErrDDLJobNotFound.Equal(err) {
Expand Down
10 changes: 5 additions & 5 deletions ddl/dist_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func (dc *ddlCtx) controlWriteTableRecord(sessPool *sessionPool, t table.Table,
return checkReorgJobFinished(dc.ctx, sess, &dc.reorgCtx, ddlJobID, currEle)
}

func (dc *ddlCtx) splitPhysicalTableToBackfillJobs(sess *session, reorgInfo *reorgInfo, sJobCtx *splitJobContext) error {
func (dc *ddlCtx) splitPhysicalTableToBackfillJobs(sess *session, reorgInfo *reorgInfo, sJobCtx *splitJobContext) {
defaultSQLMode := sess.GetSessionVars().SQLMode
defer func() { sess.GetSessionVars().SQLMode = defaultSQLMode }()
// Make timestamp type can be inserted ZeroTimestamp.
Expand All @@ -309,20 +309,20 @@ func (dc *ddlCtx) splitPhysicalTableToBackfillJobs(sess *session, reorgInfo *reo
logutil.BgLogger().Info("[ddl] split backfill jobs to table start", zap.Int64("jobID", reorgInfo.Job.ID),
zap.Stringer("ele", reorgInfo.currElement), zap.Int("donePTbls", pTblMetaCnt), zap.Bool("more", ok))
if !ok {
return nil
return
}
if err = dc.isReorgRunnable(reorgInfo.Job.ID, false); err != nil {
return err
return
}

err = dc.splitTableToBackfillJobs(sess, reorgInfo, sJobCtx, pTblMeta)
if err != nil {
return err
return
}
pTblMetaCnt++
}
}
return nil
return
}

func checkReorgJobFinished(ctx context.Context, sess *session, reorgCtxs *reorgContexts, ddlJobID int64, currEle *meta.Element) error {
Expand Down

0 comments on commit d456da2

Please sign in to comment.