Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ] - Mailing list pgsql-hackers

From Dilip kumar
Subject Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Date
Msg-id 4205E661176A124FAF891E0A6BA9135266368EB1@szxeml509-mbs.china.huawei.com
Whole thread
In response to Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
List pgsql-hackers

On 28 October 2014 09:18, Amit Kapila Wrote,

 

>I am worried about the case if after setting the inAbort flag,

>PQCancel() fails (returns error).

>> If select(maxFd + 1, workerset, NULL, NULL, &tv); come out, we can know whether it came out because of cancel query and handle it accordingly.

>> 

>Yeah, it is fine for the case when PQCancel() is successful, what

>if it fails?

>I think even if select comes out due to any other reason, it will behave

>as if it came out due to Cancel, even though actually Cancel is failed,

>how are planning to handle that case?

 

I think If PQcancel fails then also there is no problem, because we are setting inAbort flag in handle_sigint handler, it means user have tried to terminate.

 

So in this case as well we will find that inAbort is set so we return error, and in error case we finally call DisconnectDatabase, and in this function we will send the PQcancel for all active connection and then only we disconnect.

 

Regards,

DIlip

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Next
From: Amit Kapila
Date:
Subject: Re: Scaling shared buffer eviction