Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Itagaki Takahiro

Tom Lane t...@sss.pgh.pa.us wrote:

  We should call [Read dumpfile] routine only once even on Windows.
 Seems to me that you should simply do the load only when found is false.

Here is a patch to fix pg_stat_statements on Windows.

I see we don't need any locks because initialization is done in postmaster;
There are no chance to see uninitialized state of 'pgss' after relasing
AddinShmemInitLock and before load dumpfile into it.

I also check pgss_shmem_shutdown and no problem.
It is called only once from postmaster on shutdown.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



pg_stat_statements.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Alvaro Herrera
Itagaki Takahiro escribió:
 
 Tom Lane t...@sss.pgh.pa.us wrote:
 
   We should call [Read dumpfile] routine only once even on Windows.
  Seems to me that you should simply do the load only when found is false.
 
 Here is a patch to fix pg_stat_statements on Windows.

Hmm, it seems the comment just above the patched line needs to be fixed.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Tom Lane
Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp writes:
 Here is a patch to fix pg_stat_statements on Windows.

Yeah, that looks about right to me.  Committed.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes:
 Itagaki Takahiro escribió:
 Here is a patch to fix pg_stat_statements on Windows.

 Hmm, it seems the comment just above the patched line needs to be fixed.

I looked at that and decided it was OK as-is.  How do you want to
change it?

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Alvaro Herrera
Tom Lane escribió:
 Alvaro Herrera alvhe...@commandprompt.com writes:
  Itagaki Takahiro escribi�:
  Here is a patch to fix pg_stat_statements on Windows.
 
  Hmm, it seems the comment just above the patched line needs to be fixed.
 
 I looked at that and decided it was OK as-is.  How do you want to
 change it?

The reason that it doesn't need locks is not that there's no other
process running, but that it was already initialized, in the case when
found is false.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [BUGS] BUG #4941: pg_stat_statements crash

2009-07-26 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes:
 Tom Lane escribió:
 I looked at that and decided it was OK as-is.  How do you want to
 change it?

 The reason that it doesn't need locks is not that there's no other
 process running, but that it was already initialized, in the case when
 found is false.

Mph.  The comment is correct, I think, but it applies to the situation
after we pass the !found test, rather than where the comment is.  Maybe
we should just move it down one statement?

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers