Skip to content

Commit

Permalink
ddl: add empty table info
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Dec 21, 2023
1 parent 210bc42 commit 8f492a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ func splitTableRanges(t table.PhysicalTable, store kv.Storage, startKey, endKey
zap.Int64("physicalTableID", t.GetPhysicalID()),
zap.String("start key", hex.EncodeToString(startKey)),
zap.String("end key", hex.EncodeToString(endKey)))
if len(startKey) == 0 && len(endKey) == 0 {
logutil.BgLogger().Info("split table range from PD, get noop table range", zap.String("category", "ddl"), zap.Int64("physicalTableID", t.GetPhysicalID()))
return []kv.KeyRange{}, nil
}

kvRange := kv.KeyRange{StartKey: startKey, EndKey: endKey}
s, ok := store.(tikv.Storage)
if !ok {
Expand Down Expand Up @@ -673,9 +678,6 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sess.Pool, t table.Physical
if err := dc.isReorgRunnable(reorgInfo.Job.ID, false); err != nil {
return errors.Trace(err)
}
if startKey == nil && endKey == nil {
return nil
}

failpoint.Inject("MockCaseWhenParseFailure", func(val failpoint.Value) {
//nolint:forcetypeassert
Expand Down

0 comments on commit 8f492a4

Please sign in to comment.