Re: [COMMITTERS] pgsql: Ensure that top level aborts call XLogSetAsyncCommit().

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <sriggs(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Ensure that top level aborts call XLogSetAsyncCommit().
Date: 2010-05-31 11:11:47
Message-ID: AANLkTinm_kG0o-pU3uttQbRLokW0hpOiNG0arLP_5H2k@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, May 13, 2010 at 8:39 PM, Simon Riggs <sriggs(at)postgresql(dot)org> wrote:
> Log Message:
> -----------
> Ensure that top level aborts call XLogSetAsyncCommit(). Not doing
> so simply leads to data waiting in wal_buffers which then causes
> later commits to potentially do emergency writes and for all forms
> of replication to be potentially delayed without need or benefit.
> Issue pointed out exactly by Fujii Masao, following bug report
> by Robert Haas on a separate though related topic.
>
> Modified Files:
> --------------
>    pgsql/src/backend/access/transam:
>        xact.c (r1.290 -> r1.291)
>        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.290&r2=1.291)

This commit changed XLogSetAsyncCommitLSN() so that it's called
for abort case. So we need to change the comment of the function
as follows:

diff --git a/src/backend/access/transam/xlog.c
b/src/backend/access/transam/xlog.c
index c886571..ae10108 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -1860,7 +1860,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible,
bool xlog_switch)

/*
* Record the LSN for an asynchronous transaction commit.
- * (This should not be called for aborts, nor for synchronous commits.)
+ * (This should not be called for synchronous commits.)
*/
void
XLogSetAsyncCommitLSN(XLogRecPtr asyncCommitLSN)

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2010-05-31 11:48:43 Re: [COMMITTERS] pgsql: Ensure that top level aborts call XLogSetAsyncCommit().
Previous Message Heikki Linnakangas 2010-05-31 10:45:02 Re: [COMMITTERS] pgsql: In walsender, don't sleep if there's outstanding WAL waiting to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-05-31 11:48:43 Re: [COMMITTERS] pgsql: Ensure that top level aborts call XLogSetAsyncCommit().
Previous Message Heikki Linnakangas 2010-05-31 10:45:02 Re: [COMMITTERS] pgsql: In walsender, don't sleep if there's outstanding WAL waiting to