Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-09-30 Thread Julien Rouhaud
On 28/09/2016 18:46, Robert Haas wrote: > > Everybody seems happy with this fix for a first step, so I've > committed it and back-patched it to 9.3. > Thanks! -- Julien Rouhaud http://dalibo.com - http://dalibo.org -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-09-28 Thread Robert Haas
On Sat, Sep 3, 2016 at 12:29 AM, Michael Paquier wrote: > On Sat, Sep 3, 2016 at 10:02 AM, Tomas Vondra > wrote: >> In any case, I think adding the pgstat_report_stat() into worker_spi seems >> like a reasonable (and backpatchable) fix. >

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-09-02 Thread Michael Paquier
On Sat, Sep 3, 2016 at 10:02 AM, Tomas Vondra wrote: > In any case, I think adding the pgstat_report_stat() into worker_spi seems > like a reasonable (and backpatchable) fix. Doing just that sounds reasonable seen from here. I am wondering also if it would not be

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-09-02 Thread Tomas Vondra
On 07/11/2016 06:53 AM, Craig Ringer wrote: On 11 July 2016 at 11:49, Michael Paquier > wrote: On Mon, Jul 11, 2016 at 3:36 AM, Julien Rouhaud > wrote: > I'm not

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-10 Thread Craig Ringer
On 11 July 2016 at 11:49, Michael Paquier wrote: > On Mon, Jul 11, 2016 at 3:36 AM, Julien Rouhaud > wrote: > > I'm not opposed, but in this case we should also provide a proper > > documentation of all the required actions to mimick normal

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-10 Thread Michael Paquier
On Mon, Jul 11, 2016 at 3:36 AM, Julien Rouhaud wrote: > I'm not opposed, but in this case we should also provide a proper > documentation of all the required actions to mimick normal backends. I'd rather just add a note like "Have a look at PostgresMain if you want to

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-10 Thread Julien Rouhaud
On 08/07/2016 01:53, Michael Paquier wrote: > On Fri, Jul 8, 2016 at 3:06 AM, Andres Freund wrote: >> On 2016-07-07 14:04:36 -0400, Robert Haas wrote: >>> On Thu, Jul 7, 2016 at 1:52 PM, Julien Rouhaud >>> wrote: Should a bgworker modifing data

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-07 Thread Michael Paquier
On Fri, Jul 8, 2016 at 3:06 AM, Andres Freund wrote: > On 2016-07-07 14:04:36 -0400, Robert Haas wrote: >> On Thu, Jul 7, 2016 at 1:52 PM, Julien Rouhaud >> wrote: >> > Should a bgworker modifing data have to call pgstat_report_stat() to >> > avoid

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-07 Thread Andres Freund
On 2016-07-07 14:04:36 -0400, Robert Haas wrote: > On Thu, Jul 7, 2016 at 1:52 PM, Julien Rouhaud > wrote: > > Should a bgworker modifing data have to call pgstat_report_stat() to > > avoid this problem? I don't find any documentation suggesting it, and it > > seems

Re: [HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-07 Thread Robert Haas
On Thu, Jul 7, 2016 at 1:52 PM, Julien Rouhaud wrote: > While investigating on a bloat issue with a colleague, we found that if > a bgworker executes some queries with SPI, the statistic changes will > never be reported, since pgstat_report_stat() is only called in

[HACKERS] Issue with bgworker, SPI and pgstat_report_stat

2016-07-07 Thread Julien Rouhaud
Hello, While investigating on a bloat issue with a colleague, we found that if a bgworker executes some queries with SPI, the statistic changes will never be reported, since pgstat_report_stat() is only called in regular backends. In our case, the bgworker is the only process inserting and