Re: Synchronous replication - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Synchronous replication
Date
Msg-id AANLkTinxi4NCR0xa5tQ=v2uddearnwhk+k1f9GZqQb2r@mail.gmail.com
Whole thread Raw
In response to Re: Synchronous replication  (Yeb Havinga <yebhavinga@gmail.com>)
List pgsql-hackers
On Tue, Jul 27, 2010 at 8:48 PM, Yeb Havinga <yebhavinga@gmail.com> wrote:
> Is there a reason not to send the signal in XlogFlush itself, so it would be
> called at
>
> CreateCheckPoint(), EndPrepare(), FlushBuffer(),
> RecordTransactionAbortPrepared(), RecordTransactionCommit(),
> RecordTransactionCommitPrepared(), RelationTruncate(),
> SlruPhysicalWritePage(), write_relmap_file(), WriteTruncateXlogRec(), and
> xact_redo_commit().

Yes, it's because there is no need to send WAL immediately in other
than the following functions:

* EndPrepare()
* RecordTransactionAbortPrepared()
* RecordTransactionCommit()
* RecordTransactionCommitPrepared()

Some functions call XLogFlush() to follow the basic WAL rule. In the
standby, WAL records are always flushed to disk prior to any corresponding
data-file change. So, we don't need to replicate the result of XLogFlush()
immediately for the WAL rule.

Regards,

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


pgsql-hackers by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: Synchronous replication
Next
From: Fujii Masao
Date:
Subject: Re: Synchronous replication