problem (bug?) when killing client program
problem (bug?) when killing client program
От:
"Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>
Дата:
I don't know if this is a bug or feature, but here goes the report. When trying to backup a table that lives on a database with the same name, I ended issuing the wrong command and, instead, started a full dump of a multigigabyte database with pg_dump. A couple seconds later, just pressed Ctrl-C. The pg_dump, as desired, quit. After that, the follwing line was found on `ps` output: postgres 22332 26.4 4.5 96264 69980 pts/2 R 10:32 3:24 postgres: postgres [local] COPY The pg_dump process was confirmed killed and the uptime output, at the same time was: 10:41:02 up 14 days, 19:56, 3 users, load average: 20.11, 11.48, 10.28 Realizing that the things weren't quite right, sent a SIGTERM (kill with no flags) to the PID 22332. What happened? The entire backend crashed and burned in enormous flames. We're using postgres 7.4.1 on a Linux/i386 SMP machine. Ok, it wasn't nice to start a full backup when it wasn't the real intention, but shouldn't the backend process deal with these situations without crashing down and causing minors data loss in the recovery?? TIA.
Re: problem (bug?) when killing client program
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Marcus Andree S. Magalhaes" writes: > Realizing that the things weren't quite right, sent a SIGTERM (kill with > no flags) to the PID 22332. > What happened? The entire backend crashed and burned in enormous flames. SIGTERM should have been fine. Are you certain you didn't do kill -9 ? I tried the same thing here, and the backend shut down just fine, with only this entry in the postmaster log: FATAL: terminating connection due to administrator command So I think you didn't really do SIGTERM. regards, tom lane
Re: problem (bug?) when killing client program
От:
"Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>
Дата:
Yes, I sent a SIGTERM... Anyway, the fact that a postgres process was alive & kicking & eating CPU power after pg_dump exited is a normal behaviour? Best regards. > > SIGTERM should have been fine. Are you certain you didn't do kill -9 ? > > I tried the same thing here, and the backend shut down just fine, with > only this entry in the postmaster log: > FATAL: terminating connection due to administrator command > So I think you didn't really do SIGTERM. > > regards, tom lane
Re: problem (bug?) when killing client program
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Marcus Andree S. Magalhaes" writes: > Anyway, the fact that a postgres process was alive & kicking & eating > CPU power after pg_dump exited is a normal behaviour? Yes; it'll finish out the current command before noticing that the client connection was dropped. In this case the current command happened to be a long-running one ... If you can reproduce the crash-on-SIGTERM behavior I'd like to know how. *That*, if real, is a bug. regards, tom lane