Skip site navigation (1) Skip section navigation (2)

Synchronous replication patch v2

From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pavan(dot)deolasee(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Synchronous replication patch v2
Date: 2008-11-14 10:15:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Attached is the latest version of Synch Rep patch. Sorry for my late posting.
I fixed some bugs in v1patch and integrated walreceiver into core. Attached
contain some patches:

* synch_rep_v2.patch
This is the whole patch of Synch Rep against head. This also contain
"Infrastructure changes for recover" patch by Simon because I'd like to
make walreceiver work in consistent recovery mode.

To be reviewed easily, I split synch_rep_v2.patch into 8 pieces.

* 01_signal_handling_v2.patch
This is the patch of signal handling changes for Synch Rep. I already
posted this.

* 02_pqcomm_v1.patch
This is the patch of non-blocking pqcomm. Since walsender sends
xlog records and receive the reply from walreceiver concurrently, this
feature is needed.

* 03_libpq_v1.patch
This is the patch of new libpq API for Synch Rep. This is mainly used by
walreceiver. I didn't want to introduce a new communication layer,
I modified libpq for Synch Rep.

* 04_recovery_conf_v1.patch
This is the patch for postmaster to read recovery.conf like GUC.
Thereby, processes other than startup process can also get
parameters in recovery.conf. Walreceiver gets a host / port of a primary
server from recovery.conf using this feature.

* 05_split_xlogwrt_v1.patch
This is the patch of splitting XLogWrite into 3 pieces. Two of them are
used for walreceiver to write xlog records on the standby server.

* 06_walsender_v2.patch
This is the patch for sending xlog records. This contains
- walsender itself
- communication between walsender and backends
   (other than signal handling changes)
- management of xlog positions

* 07_walreceiver_v1.patch
This is the patch of walreceiver which receives and writes xlog records.
Walreceiver works in consistent recovery mode.

* 08_arch_in_recovery_v1.patch
This is the patch for archiver to work in consistent recovery mode. In
the standby server, walreceiver writes xlog records to pg_xlog, and
pg_standby reads them from archive location. So, someone has to
archive them. I make walreceiver start archiver for archiving them.

If you want to apply 8 patches one by one, please apply "Infrastructure
changes for recover" patch and create the following empty files first.
- src/backend/postmaster/walsender.c
- src/backend/postmaster/walreceiver.c
- src/include/postmaster/walsender.h
- src/include/postmaster/walreceiver.h

Since source code comments and documents are insufficient,
I think I will mainly enrich them next week. And, if there is a patch
which is hard to be reviewed, I will split it further.

Any comments welcome!


Fujii Masao
NTT Open Source Software Center

Attachment: synch_rep_patchset_v2.tgz
Description: application/x-gzip (86.2 KB)


pgsql-hackers by date

Next:From: Michael MeskesDate: 2008-11-14 10:17:27
Subject: Re: gram.y => preproc.y
Previous:From: Dave PageDate: 2008-11-14 10:04:16
Subject: Re: Simple postgresql.conf wizard

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group