On 2026-Oct-08, Manu wrote:

> Hi Kirill,
> 
> > diff also contains some code churn that makes assert failure vanish,
> > but I don't yet decide if fixing that way is OK. Looks like this just
> > masks errors.
> 
> I reproduced it on master (5c74e122ef2) and REL_19_STABLE, and your
> doubt looks right: part of the fix masks the problem.

I'm not sure that changing the FATAL to LOG is right in either REPACK or
parallel.c.  But as far as the test is concerned, it appears that
patching parallel.c and pgstat.c is enough to make the crash disappear.
pgstat.c in particular looks quite optimistic about what it's allowed to
do during catastrophic shutdown.

I'm not sure that repack.c needs any changes at all.  If it does, then I
would rather do something like

diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index a584e138ada..fc063384681 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -4022,9 +4022,12 @@ stop_repack_decoding_worker(void)
                RESUME_INTERRUPTS();
 
                if (status == BGWH_POSTMASTER_DIED)
+               {
+                       decoding_worker = NULL;
                        ereport(FATAL,
                                        errcode(ERRCODE_ADMIN_SHUTDOWN),
                                        errmsg("postmaster exited during REPACK 
command"));
+               }
        }
 


than reduce the FATAL to LOG.  I don't know if a similar reaction in
parallel.c would be appropriate.

I think the real problem is the shutdown of pgaio or pgstats.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/


Reply via email to