Обсуждение: BUG #3179: crash when canceling avacuum

Поиск
Список
Период
Сортировка

BUG #3179: crash when canceling avacuum

От
""
Дата:
The following bug has been logged online:

Bug reference:      3179
Logged by:
Email address:      cstdenis@ctgameinfo.com
PostgreSQL version: 8.2.0
Operating system:   FreeBSD 6.2
Description:        crash when canceling avacuum
Details:

I started a vacuumdb -a -v -z then changed my mind to cancled it under
pgadminIII. First try didn't seem to work to I clicked the button a few more
times. Whole server crashed.

Don't think I can reproduce it (and don't want to try) since I think it was
a race-condition or something.

It generated a core file while I have generated a backtrace of here.


ayu# gdb /usr/local/bin/postgres ./postgres.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols
found)...
Core was generated by `postgres'.
Program terminated with signal 6, Aborted.
Reading symbols from /usr/local/lib/libintl.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/local/lib/libintl.so.6
Reading symbols from /usr/lib/libssl.so.4...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libssl.so.4
Reading symbols from /lib/libcrypto.so.4...(no debugging symbols
found)...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /lib/libcrypt.so.3...(no debugging symbols
found)...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libm.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols
found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols
found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x286243df in kill () from /lib/libc.so.6
(gdb) bt
#0  0x286243df in kill () from /lib/libc.so.6
#1  0x2862437e in raise () from /lib/libc.so.6
#2  0x2862309e in abort () from /lib/libc.so.6
#3  0x082ef19b in errfinish ()
#4  0x082ef6e0 in elog_finish ()
#5  0x080aec21 in xactGetCommittedChildren ()
#6  0x080b1175 in AbortCurrentTransaction ()
#7  0x0822ec0b in PostgresMain ()
#8  0x081f1816 in ClosePostmasterPorts ()
#9  0x081f38b7 in PostmasterMain ()
#10 0x081a358f in main ()
(gdb)

Re: BUG #3179: crash when canceling avacuum

От
Alvaro Herrera
Дата:
cstdenis@ctgameinfo.com wrote:
>
> The following bug has been logged online:
>
> Bug reference:      3179
> Logged by:
> Email address:      cstdenis@ctgameinfo.com
> PostgreSQL version: 8.2.0
> Operating system:   FreeBSD 6.2
> Description:        crash when canceling avacuum
> Details:
>
> I started a vacuumdb -a -v -z then changed my mind to cancled it under
> pgadminIII. First try didn't seem to work to I clicked the button a few more
> times. Whole server crashed.

What was the error message in the server log?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

[cstdenis@ctgameinfo.com: Re: BUG #3179: crash when canceling avacuum]

От
Alvaro Herrera
Дата:
----- Forwarded message from Cstdenis <cstdenis@ctgameinfo.com> -----

From: Cstdenis <cstdenis@ctgameinfo.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Date: Wed, 21 Mar 2007 10:44:49 -0700 (PDT)
Subject: Re: [BUGS] BUG #3179: crash when canceling avacuum
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.1.3

> cstdenis@ctgameinfo.com wrote:
>>
>> The following bug has been logged online:
>>
>> Bug reference:      3179
>> Logged by:
>> Email address:      cstdenis@ctgameinfo.com
>> PostgreSQL version: 8.2.0
>> Operating system:   FreeBSD 6.2
>> Description:        crash when canceling avacuum
>> Details:
>>
>> I started a vacuumdb -a -v -z then changed my mind to cancled it under
>> pgadminIII. First try didn't seem to work to I clicked the button a few
>> more
>> times. Whole server crashed.
>
> What was the error message in the server log?
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>

Mar 20 22:29:39 ayu postgres[58424]: [1-1] WARNING:  PID 60260 is not a
PostgreSQL server process
Mar 20 22:29:48 ayu postgres[60274]: [1-1] ERROR:  canceling statement due
to user request
Mar 20 22:29:48 ayu postgres[60274]: [1-2] STATEMENT:  VACUUM FULL VERBOSE
ANALYZE;
Mar 20 22:29:48 ayu postgres[60274]: [1-3]
Mar 20 22:29:48 ayu postgres[60274]: [2-1] PANIC:  cannot abort
transaction 293233494, it was already committed
Mar 20 22:30:06 ayu kernel: pid 60274 (postgres), uid 70: exited on signal
6 (core dumped)
Mar 20 22:30:06 ayu postgres[60295]: [1-1] WARNING:  terminating
connection because of crash of another server process
Mar 20 22:30:06 ayu postgres[60295]: [1-2] DETAIL:  The postmaster has
commanded this server process to roll back the current transaction and
exit, because another server
Mar 20 22:30:06 ayu postgres[60295]: [1-3]  process exited abnormally and
possibly corrupted shared memory.
Mar 20 22:30:06 ayu postgres[60295]: [1-4] HINT:  In a moment you should
be able to reconnect to the database and repeat your command.

----- End forwarded message -----


--
Alvaro Herrera                         http://www.flickr.com/photos/alvherre/
"Oh, great altar of passive entertainment, bestow upon me thy discordant images
at such speed as to render linear thought impossible" (Calvin a la TV)

Re: [cstdenis@ctgameinfo.com: Re: BUG #3179: crash when canceling avacuum]

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> ----- Forwarded message from Cstdenis <cstdenis@ctgameinfo.com> -----
> Mar 20 22:29:48 ayu postgres[60274]: [1-1] ERROR:  canceling statement due
> to user request
> Mar 20 22:29:48 ayu postgres[60274]: [1-2] STATEMENT:  VACUUM FULL VERBOSE
> ANALYZE;
> Mar 20 22:29:48 ayu postgres[60274]: [2-1] PANIC:  cannot abort
> transaction 293233494, it was already committed

Oh, this is a well-known problem: VACUUM FULL plays a game it shouldn't
be playing with marking its transaction committed before it's really done.

I think we now have enough infrastructure to clean this up by turning
a VACUUM FULL into two successive transactions, but haven't got round to
looking at it in detail.

            regards, tom lane