On Thu, Dec 10, 2015 at 3:44 AM, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
> Most of that ideas was already mentioned in 2009 thread by Michael Paquier
http://www.postgresql.org/message-id/c64c5f8b0908062031k3ff48428j824a9a46f28180ac@mail.gmail.comwhere he suggested to
store2pc data in shared memory.
> At that time patch was declined because no significant speedup were observed. Now I see performance improvements by
mypatch at about 60%. Probably old benchmark overall tps was lower and it was harder to hit filesystem fopen/fclose
limits.
Glad to see this patch is given a second life 6 years later.
> Now results of benchmark are following (dual 6-core xeon server):
>
> Current master without 2PC: ~42 ktps
> Current master with 2PC: ~22 ktps
> Current master with 2PC: ~36 ktps
That's nice.
+ XLogRecPtr prepare_xlogptr; /* XLOG offset of prepare record start
+ * or NULL if twophase data moved to file
+ * after checkpoint.
+ */
This has better be InvalidXLogRecPtr if unused.
+ if (gxact->prepare_lsn)
+ {
+ XlogReadTwoPhaseData(gxact->prepare_xlogptr, &buf, NULL);
+ }
Perhaps you mean prepare_xlogptr here?
--
Michael