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 authored and ti-chi-bot committed Jan 24, 2024
1 parent 95464e7 commit c9423ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,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 @@ -819,9 +824,6 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sessionPool, t table.Physic
if err := dc.isReorgRunnable(reorgInfo.Job); 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 c9423ee

Please sign in to comment.