Hi Alexander,

Thank you for the report. This is an interesting case of incomplete or
incorrect error handling.

Regarding the code path in LocalExecuteInvalidationMessage:

(This can seem dubious, but I guess there could be other (perhaps more
sophisticated) ways to trigger an error somewhere inside
LocalExecuteInvalidationMessage() -> RelationCacheInvalidateEntry() ->
RelationFlushRelation() -> RelationRebuildRelation() ->
RelationBuildDesc() -> RelationBuildTupleDesc() -> systable_getnext()...)

I wonder if we should prevent adding CHECK_FOR_INTERRUPTS (CFI) calls
in this path. A quick search did not reveal any existing CFI calls
here. In your example, the CFI is triggered by the elog(LOG, "") added
to the code as part of your testing.

To prevent incomplete cache invalidation during an abort, we probably
need to avoid processing interrupts and ensure the process does not
error out. Otherwise, as you demonstrated, we risk leaving the
relcache in an inconsistent state where a stale entry remains even
after a transaction is rolled back.

Best regards,
Rahila Syed


Reply via email to