From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: lcr - walsender integration |
Date: | 2012-11-15 01:42:50 |
Message-ID: | 20121115014250.GA5844@awork2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
The current logical walsender integration looks like the following:
=# INIT_LOGICAL_REPLICATION 'text';
WARNING: Initiating logical rep
WARNING: reached consistent point, stopping!
replication_id | consistent_point | snapshot_name | plugin
----------------+------------------+---------------+--------
id-2 | 3/CACBDF98 | 0xDEADBEEF | text
(1 row)
=# START_LOGICAL_REPLICATION 'id-2' 3/CACBDF98;
...
So the current protocol is:
INIT_LOGICAL_REPLICATION '$plugin';
returns
* slot
* first consistent point
* snapshot id
START_LOGICAL_REPLICATION '$slot' $last_received_lsn;
streams changes, each wrapped in a 'w' message with (start, end) set to
the same value. The content of the data is completely free-format and
only depends on the output plugin.
Feedback is provided from the client via the normal 'r' messages.
I think thats not a bad start, but we probably can improve it a bit:
INIT_LOGICAL_REPLICATION '$slot' '$plugin' ($value = $key, ...);
START_LOGICAL_REPLICATION '$slot' $last_received_lsn;
STOP_LOGICAL_REPLICATION '$slot';
The option to INIT_LOGICAL_REPLICATION would then get passed to the
'pg_decode_init' output plugin function (i.e. a function of that name
would get dlsym()'ed using the pg infrastructure for that).
Does that look good to you? Any suggestions?
Greetings,
Andres
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2012-11-15 02:01:54 | Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY |
Previous Message | Jeff Davis | 2012-11-15 01:40:58 | Re: Enabling Checksums |