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

2009-08-09 Thread Tom Lane
Michael Paquier 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 trivial to generate enormous

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 u

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

2009-08-08 Thread Tom Lane
Heikki Linnakangas 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. > However, if the bottleneck is

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 t

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

2009-08-08 Thread Tom Lane
Robert Haas writes: > On Sat, Aug 8, 2009 at 9:31 AM, Heikki > Linnakangas 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 that surprising to me that a write to shared memory

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

2009-08-08 Thread Tom Lane
Heikki Linnakangas 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 optimization. What evidence

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 Linnakangas wrote: > Tom Lane wrote: >> Michael Paquier 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

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

2009-08-08 Thread Heikki Linnakangas
Tom Lane wrote: > Michael Paquier 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

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

2009-08-07 Thread Tom Lane
Michael Paquier 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 that the state file is g