Re: pg_stat directory and pg_stat_statements

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_stat directory and pg_stat_statements
Date: 2014-05-28 14:01:54
Message-ID: CAHGQGwF-9gyCrumiqms4tEqGXO2zmWLEgh5Grnv4QUTW0yo87w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Thanks to 187492b6c2e8cafc5b39063ca3b67846e8155d24, pgstat
files are now saved to $PGDATA/pg_stat directory at shutdown.
But pg_stat_statements file is saved under $PGDATA/global yet.
Is this intentional or just oversight? Saving that file to global is
harmless, though.

Regards,

--
Fujii Masao


From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-28 15:37:50
Message-ID: CAM3SWZQmxTDjxW_2w+M5dYL-dWkM7YiHMRKMmoyp2i_v7bAFoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> But pg_stat_statements file is saved under $PGDATA/global yet.
> Is this intentional or just oversight?

I think it's an oversight.

--
Peter Geoghegan


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-28 17:52:06
Message-ID: CAHGQGwEV9qrfdUkfahZGLOSnpaRvg0d_ufq6kVYPh9GxBUo1pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> But pg_stat_statements file is saved under $PGDATA/global yet.
>> Is this intentional or just oversight?
>
>
> I think it's an oversight.

OK, patch attached.

I'm afraid that it's not okay to change the file layout in $PGDATA at this beta1
stage because that change basically seems to need initdb. Otherwise something
like "no such file or directory" error can happen. But in this case what we need
to change is only the location of the pg_stat_statements permanent stats file.
So, without initdb, the server will not be able to find the
pg_stat_statements stats
file, but this is not so harmful. Only the problem is that the
pg_stat_statements
stats which were collected in past would disappear. OTOH, the server can keep
running successfully from then and no critical data will not
disappear. Therefore
I think we can commit this patch even at beta1. Thought?

Regards,

--
Fujii Masao

Attachment Content-Type Size
0001-Save-pg_stat_statements-statistics-file-into-PGDATA-.patch text/x-diff 2.5 KB

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-28 19:55:16
Message-ID: 53863F24.8050805@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 28.5.2014 19:52, Fujii Masao wrote:
> On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> But pg_stat_statements file is saved under $PGDATA/global yet.
>>> Is this intentional or just oversight?
>>
>>
>> I think it's an oversight.
>
> OK, patch attached.
>
> I'm afraid that it's not okay to change the file layout in $PGDATA at this beta1
> stage because that change basically seems to need initdb. Otherwise something
> like "no such file or directory" error can happen. But in this case what we need
> to change is only the location of the pg_stat_statements permanent stats file.
> So, without initdb, the server will not be able to find the
> pg_stat_statements stats
> file, but this is not so harmful. Only the problem is that the
> pg_stat_statements
> stats which were collected in past would disappear. OTOH, the server can keep
> running successfully from then and no critical data will not
> disappear. Therefore
> I think we can commit this patch even at beta1. Thought?

For HEAD, probably yes. But what about backpatching 9.3?

Tomas


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-29 03:22:19
Message-ID: CAHGQGwHNcLzkb-65Jo5C2u3UinE6ga9Nq_oeLD1-n7jkyXqJug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 4:55 AM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
> On 28.5.2014 19:52, Fujii Masao wrote:
>> On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>>> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>>> But pg_stat_statements file is saved under $PGDATA/global yet.
>>>> Is this intentional or just oversight?
>>>
>>>
>>> I think it's an oversight.
>>
>> OK, patch attached.
>>
>> I'm afraid that it's not okay to change the file layout in $PGDATA at this beta1
>> stage because that change basically seems to need initdb. Otherwise something
>> like "no such file or directory" error can happen. But in this case what we need
>> to change is only the location of the pg_stat_statements permanent stats file.
>> So, without initdb, the server will not be able to find the
>> pg_stat_statements stats
>> file, but this is not so harmful. Only the problem is that the
>> pg_stat_statements
>> stats which were collected in past would disappear. OTOH, the server can keep
>> running successfully from then and no critical data will not
>> disappear. Therefore
>> I think we can commit this patch even at beta1. Thought?
>
> For HEAD, probably yes. But what about backpatching 9.3?

I think No. So we should not backpatch this to 9.3.

Regards,

--
Fujii Masao


From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-29 04:01:04
Message-ID: CAG7mmoxPZh3auOJzw7C=g=xfwg4FH87dZAw1NmVFTsXJo0LC-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 8:52 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> On Thu, May 29, 2014 at 4:55 AM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
> > On 28.5.2014 19:52, Fujii Masao wrote:
> >> On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com>
> wrote:
> >>> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> >>>> But pg_stat_statements file is saved under $PGDATA/global yet.
> >>>> Is this intentional or just oversight?
> >>>
> >>>
> >>> I think it's an oversight.
> >>
> >> OK, patch attached.
> >>
> >> I'm afraid that it's not okay to change the file layout in $PGDATA at
> this beta1
> >> stage because that change basically seems to need initdb. Otherwise
> something
> >> like "no such file or directory" error can happen. But in this case
> what we need
> >> to change is only the location of the pg_stat_statements permanent
> stats file.
> >> So, without initdb, the server will not be able to find the
> >> pg_stat_statements stats
> >> file, but this is not so harmful. Only the problem is that the
> >> pg_stat_statements
> >> stats which were collected in past would disappear. OTOH, the server
> can keep
> >> running successfully from then and no critical data will not
> >> disappear. Therefore
> >> I think we can commit this patch even at beta1. Thought?
> >
> > For HEAD, probably yes. But what about backpatching 9.3?
>
> I think No. So we should not backpatch this to 9.3.
>
Just curious.
Will it work in upgrade scenario?

--

Thanks & Regards,
Ashesh Vashi

>
> Regards,
>
> --
> Fujii Masao
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-29 05:49:13
Message-ID: CAHGQGwEBA5gQ=yps4o8hhfrjEH1WissLnVcHbmJmFWBCMkd5sA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 1:01 PM, Ashesh Vashi
<ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
> On Thu, May 29, 2014 at 8:52 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>> On Thu, May 29, 2014 at 4:55 AM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
>> > On 28.5.2014 19:52, Fujii Masao wrote:
>> >> On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com>
>> >> wrote:
>> >>> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
>> >>> wrote:
>> >>>> But pg_stat_statements file is saved under $PGDATA/global yet.
>> >>>> Is this intentional or just oversight?
>> >>>
>> >>>
>> >>> I think it's an oversight.
>> >>
>> >> OK, patch attached.
>> >>
>> >> I'm afraid that it's not okay to change the file layout in $PGDATA at
>> >> this beta1
>> >> stage because that change basically seems to need initdb. Otherwise
>> >> something
>> >> like "no such file or directory" error can happen. But in this case
>> >> what we need
>> >> to change is only the location of the pg_stat_statements permanent
>> >> stats file.
>> >> So, without initdb, the server will not be able to find the
>> >> pg_stat_statements stats
>> >> file, but this is not so harmful. Only the problem is that the
>> >> pg_stat_statements
>> >> stats which were collected in past would disappear. OTOH, the server
>> >> can keep
>> >> running successfully from then and no critical data will not
>> >> disappear. Therefore
>> >> I think we can commit this patch even at beta1. Thought?
>> >
>> > For HEAD, probably yes. But what about backpatching 9.3?
>>
>> I think No. So we should not backpatch this to 9.3.
>
> Just curious.
> Will it work in upgrade scenario?

You're concerned about the scenario using pg_upgrade? I'm not sure the detail
of pg_upgrade. But if it doesn't work properly, we should have gotten
the trouble
when 9.3 (which pg_stat directory was introduced) was released. But I've not
heard such trouble....

Regards,

--
Fujii Masao


From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-29 06:02:27
Message-ID: CAM3SWZSU8CwXQjr-VeC=g5DQe+YGW_au0gOd+-Tt7aSZKO9t1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> You're concerned about the scenario using pg_upgrade? I'm not sure the detail
> of pg_upgrade. But if it doesn't work properly, we should have gotten
> the trouble

I'm not worried about pg_upgrade, because by design pg_stat_statements
will discard stats files that originated in earlier versions. However,
I don't see a need to change pg_stat_statements to serialize its
statistics to disk in the pg_stat directory before we branch off 9.4.
As you mentioned, it's harmless.

--
Peter Geoghegan


From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-05-29 06:26:45
Message-ID: CAG7mmoxvDUkSjOpH7roHOEssdooXxftLyqDw6utCONg2q7yH6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 11:32 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:

> On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> > You're concerned about the scenario using pg_upgrade?
>
Yeah - I was.

> I'm not sure the detail
> > of pg_upgrade. But if it doesn't work properly, we should have gotten
> > the trouble
>
> I'm not worried about pg_upgrade, because by design pg_stat_statements
> will discard stats files that originated in earlier versions. However,
> I don't see a need to change pg_stat_statements to serialize its
> statistics to disk in the pg_stat directory before we branch off 9.4.
> As you mentioned, it's harmless.
>
K.
I was just curious about the scenario.
If it was discarding the stats files that originated in earlier version, It
should be ok.

--

Thanks & Regards,
Ashesh Vashi

>
> --
> Peter Geoghegan
>


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-02 13:59:55
Message-ID: CAHGQGwEH1p2jj4kG33xm0qH0LwLyp7=Dn6A5WvQzv3HGuTbbLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 29, 2014 at 3:02 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> You're concerned about the scenario using pg_upgrade? I'm not sure the detail
>> of pg_upgrade. But if it doesn't work properly, we should have gotten
>> the trouble
>
> I'm not worried about pg_upgrade, because by design pg_stat_statements
> will discard stats files that originated in earlier versions. However,
> I don't see a need to change pg_stat_statements to serialize its
> statistics to disk in the pg_stat directory before we branch off 9.4.
> As you mentioned, it's harmless.

Yeah, that's an idea. OTOH, there is no *strong* reason to postpone
the fix to 9.5. So I just feel inclined to apply the fix now...

Regards,

--
Fujii Masao


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-02 14:07:03
Message-ID: 20140602140703.GI4286@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-06-02 22:59:55 +0900, Fujii Masao wrote:
> On Thu, May 29, 2014 at 3:02 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> > On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> >> You're concerned about the scenario using pg_upgrade? I'm not sure the detail
> >> of pg_upgrade. But if it doesn't work properly, we should have gotten
> >> the trouble
> >
> > I'm not worried about pg_upgrade, because by design pg_stat_statements
> > will discard stats files that originated in earlier versions. However,
> > I don't see a need to change pg_stat_statements to serialize its
> > statistics to disk in the pg_stat directory before we branch off 9.4.
> > As you mentioned, it's harmless.
>
> Yeah, that's an idea. OTOH, there is no *strong* reason to postpone
> the fix to 9.5. So I just feel inclined to apply the fix now...

+1 for fixing it now.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-02 22:22:13
Message-ID: CAB7nPqSR4+SSX3jV6RSJ0VQCRSVDT6H70ZUsxca14M4Za2htxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 2, 2014 at 11:07 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-06-02 22:59:55 +0900, Fujii Masao wrote:
>> On Thu, May 29, 2014 at 3:02 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>> > On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> >> You're concerned about the scenario using pg_upgrade? I'm not sure the detail
>> >> of pg_upgrade. But if it doesn't work properly, we should have gotten
>> >> the trouble
>> >
>> > I'm not worried about pg_upgrade, because by design pg_stat_statements
>> > will discard stats files that originated in earlier versions. However,
>> > I don't see a need to change pg_stat_statements to serialize its
>> > statistics to disk in the pg_stat directory before we branch off 9.4.
>> > As you mentioned, it's harmless.
>>
>> Yeah, that's an idea. OTOH, there is no *strong* reason to postpone
>> the fix to 9.5. So I just feel inclined to apply the fix now...
>
> +1 for fixing it now.
+1. A beta is here for that as well.
--
Michael


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-03 09:38:24
Message-ID: CABUevEwyooQVJquMxzXjhTiyhQ6M1B4rxYSxfpbDNYXiQzYzUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 2, 2014 at 4:07 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:

> On 2014-06-02 22:59:55 +0900, Fujii Masao wrote:
> > On Thu, May 29, 2014 at 3:02 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> > > On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> > >> You're concerned about the scenario using pg_upgrade? I'm not sure
> the detail
> > >> of pg_upgrade. But if it doesn't work properly, we should have gotten
> > >> the trouble
> > >
> > > I'm not worried about pg_upgrade, because by design pg_stat_statements
> > > will discard stats files that originated in earlier versions. However,
> > > I don't see a need to change pg_stat_statements to serialize its
> > > statistics to disk in the pg_stat directory before we branch off 9.4.
> > > As you mentioned, it's harmless.
> >
> > Yeah, that's an idea. OTOH, there is no *strong* reason to postpone
> > the fix to 9.5. So I just feel inclined to apply the fix now...
>
> +1 for fixing it now.
>
>
+1 for fixing it for 9.4 before the next beta, but *not* backpatching it to
9.3 - it *is* a behaviour change after all..

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-04 03:28:34
Message-ID: CAHGQGwFGx1gufksQ0BT3E02veDeKJJ0YnBZjCPS_woVFXdknOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 3, 2014 at 6:38 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Mon, Jun 2, 2014 at 4:07 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
> wrote:
>>
>> On 2014-06-02 22:59:55 +0900, Fujii Masao wrote:
>> > On Thu, May 29, 2014 at 3:02 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>> > > On Wed, May 28, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
>> > > wrote:
>> > >> You're concerned about the scenario using pg_upgrade? I'm not sure
>> > >> the detail
>> > >> of pg_upgrade. But if it doesn't work properly, we should have gotten
>> > >> the trouble
>> > >
>> > > I'm not worried about pg_upgrade, because by design pg_stat_statements
>> > > will discard stats files that originated in earlier versions. However,
>> > > I don't see a need to change pg_stat_statements to serialize its
>> > > statistics to disk in the pg_stat directory before we branch off 9.4.
>> > > As you mentioned, it's harmless.
>> >
>> > Yeah, that's an idea. OTOH, there is no *strong* reason to postpone
>> > the fix to 9.5. So I just feel inclined to apply the fix now...
>>
>> +1 for fixing it now.
>>
>
> +1 for fixing it for 9.4 before the next beta, but *not* backpatching it to
> 9.3 - it *is* a behaviour change after all..

Yep, I just applied the patch only to HEAD.

Regards,

--
Fujii Masao


From: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-17 05:11:49
Message-ID: CAEZqfEc2XrUgvFhM=7w9XsSOgK=LgXEiFVjObWaXV1XToFBvDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii-san,

I agree not to backpatch, but I noticed that the 9.3 document about
stats collector doesn't mention $PGDATA/pg_stat.

http://www.postgresql.org/docs/current/static/monitoring-stats.html

It just says:
> When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts.

I'm not sure whether we should modify the 9.3 document at the moment,
but actually the description made me confused a bit.

2014-05-29 12:22 GMT+09:00 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> On Thu, May 29, 2014 at 4:55 AM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
>> On 28.5.2014 19:52, Fujii Masao wrote:
>>> On Thu, May 29, 2014 at 12:37 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>>>> On Wed, May 28, 2014 at 7:01 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>>>> But pg_stat_statements file is saved under $PGDATA/global yet.
>>>>> Is this intentional or just oversight?
>>>>
>>>>
>>>> I think it's an oversight.
>>>
>>> OK, patch attached.
>>>
>>> I'm afraid that it's not okay to change the file layout in $PGDATA at this beta1
>>> stage because that change basically seems to need initdb. Otherwise something
>>> like "no such file or directory" error can happen. But in this case what we need
>>> to change is only the location of the pg_stat_statements permanent stats file.
>>> So, without initdb, the server will not be able to find the
>>> pg_stat_statements stats
>>> file, but this is not so harmful. Only the problem is that the
>>> pg_stat_statements
>>> stats which were collected in past would disappear. OTOH, the server can keep
>>> running successfully from then and no critical data will not
>>> disappear. Therefore
>>> I think we can commit this patch even at beta1. Thought?
>>
>> For HEAD, probably yes. But what about backpatching 9.3?
>
> I think No. So we should not backpatch this to 9.3.
>
> Regards,
>
> --
> Fujii Masao
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Shigeru HANADA


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-18 03:39:22
Message-ID: CAHGQGwF0YLqGhfJaw2fbTpnNTBhNRVOa2z0f-aHatQPxNn+ctw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 17, 2014 at 2:11 PM, Shigeru Hanada
<shigeru(dot)hanada(at)gmail(dot)com> wrote:
> Fujii-san,
>
> I agree not to backpatch, but I noticed that the 9.3 document about
> stats collector doesn't mention $PGDATA/pg_stat.
>
> http://www.postgresql.org/docs/current/static/monitoring-stats.html
>
> It just says:
>> When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts.
>
> I'm not sure whether we should modify the 9.3 document at the moment,
> but actually the description made me confused a bit.

Could you check 8dc90b9c4c45fa30a8f59313e21d294529ef7182 in REL9_3_STABLE
branch? You can see that I added the description of pg_stat directory
into the document
in 9.3.

Regards,

--
Fujii Masao


From: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat directory and pg_stat_statements
Date: 2014-06-19 23:33:20
Message-ID: CAEZqfEdxnKK0fJcQt_y4i3bc5PhCQP1S9YaQX_d70L7GV2ocsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii-san,

I found the right description in REL9_3_STABLE branch, thanks for
pointing out the commit.

Sorry for noise.

2014-06-18 12:39 GMT+09:00 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> On Tue, Jun 17, 2014 at 2:11 PM, Shigeru Hanada
> <shigeru(dot)hanada(at)gmail(dot)com> wrote:
>> Fujii-san,
>>
>> I agree not to backpatch, but I noticed that the 9.3 document about
>> stats collector doesn't mention $PGDATA/pg_stat.
>>
>> http://www.postgresql.org/docs/current/static/monitoring-stats.html
>>
>> It just says:
>>> When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts.
>>
>> I'm not sure whether we should modify the 9.3 document at the moment,
>> but actually the description made me confused a bit.
>
> Could you check 8dc90b9c4c45fa30a8f59313e21d294529ef7182 in REL9_3_STABLE
> branch? You can see that I added the description of pg_stat directory
> into the document
> in 9.3.
>
> Regards,
>
> --
> Fujii Masao

--
Shigeru HANADA