On Tue, Jul 25, 2023 at 10:41:57PM -0400, Tom Lane wrote:
> As I said earlier, I think that's a purely coincidental "fix" for
> this specific manifestation. Either SearchSysCacheExists followed
> by a syscache lookup of the same tuple should be considered safe,
> or it shouldn't. If it should be considered safe, we need to fix the
> cache-clobber test scaffolding to not give a false positive. While if
> it shouldn't, we need to get rid of that coding pattern, not apply
> high-level band-aids that remove just one particular path to reaching
> the problem. I'm not dead set on either answer at this point, but
> I think those are the plausible alternatives.
FWIW, I'm having a hard time thinking about a reason that we should
not support SearchSysCacheExists()+lookup to be a valid pattern, even
if the cache is clobbered. I am pretty sure that there are other code
paths in the tree, not mentioned on this thread, that do exactly that
(haven't checked, but indexcmds.c is one coming in mind).
--
Michael