code: func (w *worker) waitSchemaSynced(d *ddlCtx, job *model.Job, waitTime time.Duration) {
  	if !job.IsRunning() && !job.IsRollingback() && !job.IsDone() && !job.IsRollbackDone() {
  		return
  	}
  	// TODO: Make ctx exits when the d is close.
  	ctx, cancelFunc := context.WithTimeout(context.Background(), waitTime)
  	defer cancelFunc()
  
  	latestSchemaVersion, err := d.schemaSyncer.MustGetGlobalVersion(ctx)
  	if err != nil {
  		logutil.Logger(w.logCtx).Warn("[ddl] get global version failed", zap.Error(err))
  		return
  	}
  	w.waitSchemaChanged(ctx, d, waitTime, latestSchemaVersion, job)
  }
docs: // waitSchemaSynced handles the following situation:
  // If the job enters a new state, and the worker crashs when it's in the process of waiting for 2 * lease time,
  // Then the worker restarts quickly, we may run the job immediately again,
  // but in this case we don't wait enough 2 * lease time to let other servers update the schema.
  // So here we get the latest schema version to make sure all servers' schema version update to the latest schema version
  // in a cluster, or to wait for 2 * lease time.