On Wed, May 18, 2022 at 6:26 PM Zhihong Yu <zyu@yugabyte.com> wrote:
> + accessMethodId = ((Form_pg_class) GETSTRUCT(tup))->relam; > > - /* look up the access method, verify it is for a table */ > - if (accessMethod != NULL) > - accessMethodId = get_table_am_oid(accessMethod, false); > + if (!HeapTupleIsValid(tup)) > + elog(ERROR, "cache lookup failed for relation %u", relid); > > The validity check of tup should be done before fetching the value of relam field.