Re: autovacuum process (PID ...) was terminated by signal 11 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: autovacuum process (PID ...) was terminated by signal 11
Date
Msg-id 6339.1136402283@sss.pgh.pa.us
Whole thread Raw
In response to Re: autovacuum process (PID ...) was terminated by signal 11  (Brian Hirt <bhirt@mobygames.com>)
Responses Re: autovacuum process (PID ...) was terminated by signal 11
List pgsql-bugs
Brian Hirt <bhirt@mobygames.com> writes:
> Also, if a patch is produced, I'd love to get a copy of it.

I concluded that patching vacuum.c was much the cleanest way to do it.
Here's the patch against 8.1 branch.

            regards, tom lane

Index: src/backend/commands/vacuum.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/commands/vacuum.c,v
retrieving revision 1.317.2.1
diff -c -r1.317.2.1 vacuum.c
*** src/backend/commands/vacuum.c    22 Nov 2005 18:23:08 -0000    1.317.2.1
--- src/backend/commands/vacuum.c    4 Jan 2006 19:10:35 -0000
***************
*** 510,515 ****
--- 510,523 ----
           * PostgresMain().
           */
          StartTransactionCommand();
+         /*
+          * Re-establish the transaction snapshot.  This is wasted effort
+          * when we are called as a normal utility command, because the
+          * new transaction will be dropped immediately by PostgresMain();
+          * but it's necessary if we are called from autovacuum because
+          * autovacuum might continue on to do an ANALYZE-only call.
+          */
+         ActiveSnapshot = CopySnapshot(GetTransactionSnapshot());
      }

      if (vacstmt->vacuum)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2143: Indexes incorrectly created from database dump
Next
From: Brian Hirt
Date:
Subject: Re: autovacuum process (PID ...) was terminated by signal 11