[Looks like this mail missed the hackers list on reply to all, I wonder
how it could happen... so I forward it]
On Thu, 2008-05-29 at 17:00 +0100, Dave Page wrote:
> Yes, we're talking real-time streaming (synchronous) log shipping.
Is there any design already how would this be implemented ?
Some time ago I was interested in this subject and thought about having
a normal postgres connection where the slave would issue a query to a
special view which would simply stream WAL records as bytea from a
requested point, without ever finishing. This would have the advantage
(against a custom socket streaming solution) that it can reuse the
complete infrastructure of connection making/managing/security (think
SSL for no sniffing) of the postgres server. It would also be a public
interface, which could be used by other possible tools too (think PITR
management application/WAL stream repository). Another advantage would
be that a PITR solution could be serving as a source for the WAL stream
too, so the slave could either get the real time stream from the master,
or rebuild a PITR state from a WAL repository server, using the same
interface...
Probably some kind of WAL subscription management should be also
implemented, so that the slave can signal the master which WAL records
it already applied and can be recycled on the master, and it would be
nice if there could be multiple subscribers at the same time. Some
subscriber time-out could be also implemented, while marking the
subscription as timed out, so that the slave can know that it has to
rebuild itself...
Cheers,
Csaba.