SpongeRobert opened a new pull request, #2581:
URL: https://github.com/apache/age/pull/2581

   Fixes #2580.
   
   With `age` in `shared_preload_libraries`, the `post_parse_analyze` hook runs 
for the `ROLLBACK` of a failed transaction too. If the caches of that backend 
were reset in the meantime, `is_age_extension_exists()` reads `pg_extension` 
(and `pg_class`) in `TBLOCK_ABORT`, after the resource owner was released: 
`ResourceOwnerEnlarge called after release started`. The locks leak into the 
PGPROC, and every later backend on it fails at connect with `failed to re-find 
shared lock object` until the server restarts. The mechanism, a gdb stack of 
the failing path and a standalone reproduction are in #2580.
   
   The fix returns `false` outside a live transaction and caches nothing, so 
the next live transaction asks the catalog again. In an aborted transaction 
only the statements that leave it reach the parser, and AGE has nothing to 
analyse in them.
   
   **Verified** on PostgreSQL 18.6, `master` at `fa109ef1dd`:
   
   - the reproduction of #2580 on ten fresh servers each: 10 of 10 reproduced 
without the change, 0 of 10 with it (`ROLLBACK` no longer fails);
   - `make installcheck`: 42 of 42 with the change;
   - a build of PostgreSQL 18.6 with `--enable-cassert` (AGE `PG18` head, 
`e43dc1a`): without the change the reproduction trips 
`Assert("IsTransactionState()")` in `AssertCouldGetRelation()` on the 
`ROLLBACK`; with it, no assertion failure, no error and no XX000.
   
   No regression test is added: the failure needs a backend held stopped while 
another session overflows the shared invalidation queue, and then every free 
PGPROC taken, which `pg_regress` cannot express. The same change applies 
cleanly to `PG18` (`e43dc1a`), where it was verified the same way.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to