code: func (w *worker) updateReorgInfo(t table.PartitionedTable, reorg *reorgInfo) (bool, error) {
  	pi := t.Meta().GetPartitionInfo()
  	if pi == nil {
  		return true, nil
  	}
  
  	pid, err := findNextPartitionID(reorg.PhysicalTableID, pi.Definitions)
  	if err != nil {
  		// Fatal error, should not run here.
  		logutil.Logger(ddlLogCtx).Error("[ddl] find next partition ID failed", zap.Reflect("table", t), zap.Error(err))
  		return false, errors.Trace(err)
  	}
  	if pid == 0 {
  		// Next partition does not exist, all the job done.
  		return true, nil
  	}
  
  	start, end, err := getTableRange(reorg.d, t.GetPartition(pid), reorg.Job.SnapshotVer, reorg.Job.Priority)
  	if err != nil {
  		return false, errors.Trace(err)
  	}
  	reorg.StartHandle, reorg.EndHandle, reorg.PhysicalTableID = start, end, pid
  
  	// Write the reorg info to store so the whole reorganize process can recover from panic.
  	err = kv.RunInNewTxn(reorg.d.store, true, func(txn kv.Transaction) error {
  		return errors.Trace(reorg.UpdateReorgMeta(txn, reorg.StartHandle, reorg.EndHandle, reorg.PhysicalTableID))
  	})
  	logutil.Logger(ddlLogCtx).Info("[ddl] job update reorgInfo", zap.Int64("jobID", reorg.Job.ID), zap.Int64("partitionTableID", pid), zap.Int64("startHandle", start), zap.Int64("endHandle", end), zap.Error(err))
  	return false, errors.Trace(err)
  }
docs: // updateReorgInfo will find the next partition according to current reorgInfo.
  // If no more partitions, or table t is not a partitioned table, returns true to
  // indicate that the reorganize work is finished.