Re: pg_restore cancel TODO

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_restore cancel TODO
Date: 2015-10-19 16:26:21
Message-ID: CAMkU=1yssGV_3ZnwpBBeBa3QuW-VwbqEJ064bGZcyhDdnf1WMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 19, 2015 at 8:28 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Jeff Janes wrote:
> >> I've added the TODO item:
> >>
> >> When pg_upgrade -j ... is interrupted (for example, ctrl-C from the
> >> keyboard) make it cancel the children processes.
> >>
> >> The context where this arises is that I want to populate data into a new
> >> installation compiled with a patch under review, but immediately get
> error
> >> messages indicating I forgot to install a required extension. I hit
> ctrl-C
> >> so I can fix the problem, but it keeps running anyway.
>
> > This looks more like a bug to me than a To-do item.
>
> Why doesn't the control-C kill all the child processes automatically?
> I'd have expected it to ...
>

It seems like gdb eats signals that you send a process while it is being
debugged, so it is hard to figure out what is going on. From strace, it
looks like the children do receive a signal but either ignore it, or set a
flag and then ignore that.

It doesn't continue to load the entire dump file, it exits once they
complete the current assignment and ask the parent for more work.

Could just be a matter of adding the local equivalent of
CHECK_FOR_INTERRUPTS in the part of the code that spools COPY data to the
backends? I'm not sure what would happen if it were in the
index/constraint building phase, I've never let it get that far when it
reported errors early on.

(This is linux, sorry for not making that clear)

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-10-19 16:37:41 Re: pg_restore cancel TODO
Previous Message Stephen Frost 2015-10-19 16:12:40 Re: SuperUser check in pg_stat_statements