code: func (t *tableCommon) removeRowIndices(ctx sessionctx.Context, h int64, rec []types.Datum) error {
  	txn, err := ctx.Txn(true)
  	if err != nil {
  		return err
  	}
  	for _, v := range t.DeletableIndices() {
  		vals, err := v.FetchValues(rec, nil)
  		if err != nil {
  			logutil.Logger(context.Background()).Info("remove row index failed", zap.Any("index", v.Meta()), zap.Uint64("txnStartTS", txn.StartTS()), zap.Int64("handle", h), zap.Any("record", rec), zap.Error(err))
  			return err
  		}
  		if err = v.Delete(ctx.GetSessionVars().StmtCtx, txn, vals, h, txn); err != nil {
  			if v.Meta().State != model.StatePublic && kv.ErrNotExist.Equal(err) {
  				// If the index is not in public state, we may have not created the index,
  				// or already deleted the index, so skip ErrNotExist error.
  				logutil.Logger(context.Background()).Debug("row index not exists", zap.Any("index", v.Meta()), zap.Uint64("txnStartTS", txn.StartTS()), zap.Int64("handle", h))
  				continue
  			}
  			return err
  		}
  	}
  	return nil
  }
docs: // removeRowIndices removes all the indices of a row.