code: func Txn(c context.Context, name string, cb func(context.Context) error) error {
  	c = logging.SetField(c, "txn", name)
  
  	var attempt int
  	var innerErr error
  
  	err := datastore.RunInTransaction(c, func(c context.Context) error {
  		attempt++
  		if attempt != 1 {
  			logging.Warningf(c, "Retrying the transaction: failed to commit")
  		}
  		innerErr = cb(c)
  		return innerErr
  	}, nil)
  
  	if err != innerErr {
  		return errors.Annotate(err, "failed to land %s transaction", name).Tag(transient.Tag).Err()
  	}
  	return innerErr
  }
docs: // Txn runs the callback in a datastore transaction, marking commit errors with
  // transient tag.
  //
  // The given name will be used for logging and error messages.