Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]

From: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jan Lentfer <Jan(dot)Lentfer(at)web(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>
Subject: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Date: 2014-10-07 05:33:52
Message-ID: 4205E661176A124FAF891E0A6BA9135266363710@szxeml509-mbs.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26 September 2014 01:24, Jeff Janes Wrote,

>I think you have an off-by-one error in the index into the array of file handles.

>Actually the problem is that the socket for the master connection was not getting initialized, see my one line addition here.

> connSlot = (ParallelSlot*)pg_malloc(concurrentCons * sizeof(ParallelSlot));
> connSlot[0].connection = conn;
>+ connSlot[0].sock = PQsocket(conn);

Thanks for the review, I have fixed this.

>However, I don't think it is good to just ignore errors from the select call (like the EBADF) and go into a busy loop instead, so there are more changes needed than this.

Actually this select_loop function I have implemented same as other client application are handling, i.e pg_dum in parallel.c, however parallel.c is handling the case if process is in abort (if Ctrl+c is recieved),
And we need to handle the same, so I have fixed this in attached patch.

>Also, cancelling the run (by hitting ctrl-C in the shell that invoked it) does not seem to work on linux. I get a message that says "Cancel request sent", but then it continues to finish the job anyway.
Apart from above mentioned reason, GetQueryResult was also not setting “SetCancelConn” as Amit has pointed, now this is also fixed.

Regards,
Dilip Kumar

Attachment Content-Type Size
vacuumdb_parallel_v15.patch application/octet-stream 25.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip kumar 2014-10-07 05:40:39 Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Previous Message Craig Ringer 2014-10-07 05:04:54 Re: Corporate and Individual Contributor License Agreements (CLAs)