code: func bootstrap(s Session) {
  	dom := domain.GetDomain(s)
  	for {
  		b, err := checkBootstrapped(s)
  		if err != nil {
  			logutil.Logger(context.Background()).Fatal("check bootstrap error",
  				zap.Error(err))
  		}
  		// For rolling upgrade, we can't do upgrade only in the owner.
  		if b {
  			upgrade(s)
  			return
  		}
  		// To reduce conflict when multiple TiDB-server start at the same time.
  		// Actually only one server need to do the bootstrap. So we chose DDL owner to do this.
  		if dom.DDL().OwnerManager().IsOwner() {
  			doDDLWorks(s)
  			doDMLWorks(s)
  			return
  		}
  		time.Sleep(200 * time.Millisecond)
  	}
  }
docs: // bootstrap initiates system DB for a store.