Re: Synchronous Log Shipping Replication - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: Synchronous Log Shipping Replication
Date
Msg-id 48C50083.2090509@bluegap.ch
Whole thread Raw
In response to Re: Synchronous Log Shipping Replication  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Synchronous Log Shipping Replication  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-hackers
Hi,

ITAGAKI Takahiro wrote:
> Are there any better idea to share one socket connection between
> backends (and bgwriter)? The connections could be established after
> fork() from postmaster, and number of them could be two or more.
> This is one of the most complicated part of synchronous log shipping.
> Switching-processes apporach like b) is just one idea for it.

I fear I'm repeating myself, but I've had the same problem for 
Postgres-R and solved it with an internal message passing infrastructure 
which I've simply called imessages. It requires only standard Postgres 
shared memory, signals and locking and should thus be pretty portable.

In simple benchmarks, it's not quite as efficient as unix pipes, but 
doesn't require as many file descriptors, is independent of the 
parent-child relations of processes, maintains message borders and it is 
more portable (I hope). It could certainly be improved WRT efficiency 
and could theoretically even beat Unix pipes, because it involves less 
copying of data and less syscalls.

It has not been reviewed nor commented much. I'd still appreciate that.

Regards

Markus Wanner



pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Synchronous Log Shipping Replication
Next
From: Heikki Linnakangas
Date:
Subject: Re: Our CLUSTER implementation is pessimal