WAL Info messages

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WAL Info messages
Date: 2009-12-13 19:20:26
Message-ID: 1260732026.1955.128.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


One of the reasons for last years Rmgr plugin patch was the idea of a
signalling interface between Primary and Standby nodes. Such a feature
would help in producing further programmatic tests for Hot Standby.

Proposal is to use up the last rmgr id, slot 7: RM_INFO_ID.
Functions would be provided on primary side to send a user-defined
binary message into WAL stream, with a single message type
XLOG_INFO_MSG. (Superuser only, though can be wrapped and given to
trusted users).

On Standby side, we would provide a plugin interface to allow the
message to be read and handled by user-written code. This would then
allow a simple value or notification to be passed to a waiting (polling)
connection on standby. If new LISTEN/NOTIFY gets into 8.5 then this
would be an obvious fit, but I have no need for message passing, just
info passing, so no need to wait for that; something much simpler.

We could do this by adding stuff into Streaming Rep patch, but seems
best to provide a generic interface that lives in the WAL stream itself,
rather than being at a meta level and divorced from the WAL.

This would allow the writing of a test suite that can create certain
conditions on the primary, then send notification of the event to the
standby. Standby would then halt recovery in a precise state while a
user runs an appropriate test.

--
Simon Riggs www.2ndQuadrant.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-12-13 19:20:27 Hot Standby, release candidate?
Previous Message Joe Conway 2009-12-13 18:53:50 Re: compiling with Visual Studio