Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-10 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: After making a lot of tests, state file size is not more than 600B. In some cases, it reached a maximum of size of 712B and I used such transactions in my tests. I can only say that that demonstrates you didn't test very many cases. It is

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-09 Thread Michael Paquier
After making a lot of tests, state file size is not more than 600B. In some cases, it reached a maximum of size of 712B and I used such transactions in my tests. I think setting the size parameter for this would be a frightfully difficult problem; the fact that average installations wouldn't

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Heikki Linnakangas
Tom Lane wrote: Michael Paquier michael.paqu...@gmail.com writes: Based on an idea of Heikki Linnakangas, here is a patch in order to improve 2PC by sending the state files of prepared transactions to shared memory instead of disk. I don't understand how this can possibly work. The entire

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Robert Haas
On Sat, Aug 8, 2009 at 9:31 AM, Heikki Linnakangasheikki.linnakan...@enterprisedb.com wrote: Tom Lane wrote: Michael Paquier michael.paqu...@gmail.com writes: Based on an idea of Heikki Linnakangas, here is a patch in order to improve 2PC by sending the state files of prepared transactions to

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Tom Lane wrote: Quite aside from that, the fixed size of shared memory makes this seem pretty impractical. Most state files are small. If one doesn't fit in the area reserved for this, it's written to disk as usual. It's just an

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, Aug 8, 2009 at 9:31 AM, Heikki Linnakangasheikki.linnakan...@enterprisedb.com wrote: I'm a bit disappointed by the performance gains. I would've expected more, given a decent battery-backed-up cache to buffer the WAL fsyncs. It doesn't seem

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Heikki Linnakangas
Tom Lane wrote: What if PREPARE simply didn't write the 2PC file at all, except into WAL? Then, make CheckPointTwoPhase write the 2PC file for any still-live GXACT, by means of reaching into the WAL and pulling the data out. All it would need for that is the LSN of the WAL record, which I

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-08 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Tom Lane wrote: What if PREPARE simply didn't write the 2PC file at all, except into WAL? Interesting idea, might be worth performance testing. Peeking into the WAL files during normal operation feels naughty, but it should work.

Re: [HACKERS] [PATCH] 2PC state files on shared memory

2009-08-07 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: Based on an idea of Heikki Linnakangas, here is a patch in order to improve 2PC by sending the state files of prepared transactions to shared memory instead of disk. I don't understand how this can possibly work. The entire point of 2PC is