pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #13448: DOC about : pg_dump use logical replication snapshot
2+ messages / 2 participants
[nested] [flat]
* BUG #13448: DOC about : pg_dump use logical replication snapshot
@ 2015-06-17 00:45 digoal@126.com
2015-06-18 00:39 ` Re: BUG #13448: DOC about : pg_dump use logical replication snapshot Michael Paquier <michael.paquier@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: digoal@126.com @ 2015-06-17 00:45 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 13448
Logged by: digoal
Email address: digoal@126.com
PostgreSQL version: Unsupported/Unknown
Operating system: CentOS 6.x x64
Description:
PostgreSQL 9.5 release notes:
E.1.3.9.2. pg_dump
Allow pg_dump to share a snapshot taken by another session using --snapshot
(Simon Riggs, Michael Paquier)
The remote snapshot must have been exported by pg_export_snapshot() or been
defined when creating a logical replication slot. This can be used by
parallel pg_dump to use a consistent snapshot across pg_dump processes.
There is no problem, But how to use a logical replication slot's snapshot?
Now we must do it manual?
Like this:
pg95@db-172-16-3-150-> psql 'hostaddr=127.0.0.1 port=1922 user=postgres
dbname=postgres replication=database'
psql (9.5devel)
Type "help" for help.
postgres=# CREATE_REPLICATION_SLOT ab12 LOGICAL
"/opt/pgsql9.5/lib/test_decoding.so";
slot_name | consistent_point | snapshot_name | output_plugin
-----------+------------------+---------------+------------------------------------
ab12 | 7/77B59A00 | 00000736-1 |
/opt/pgsql9.5/lib/test_decoding.so
(1 row)
pg95@db-172-16-3-150-> pg_dump --snapshot=00000736-1
And there is no document descript it.
Another command pg_recvlogical also can use stream replication protocol to
create slot,but it exit soon and no any snapshot info output to stdout, we
can use log_replication_commands to trace the snapshot, but we cann't use it
because pg_recvlogical exit soon.
I think , pg_recvlogical can add option --wait-dump | --wait second for
--create-slot, wait a moment or wait some body import the snapshot, then
close it or send the next replication commands.
Regards,
Digoal
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #13448: DOC about : pg_dump use logical replication snapshot
2015-06-17 00:45 BUG #13448: DOC about : pg_dump use logical replication snapshot digoal@126.com
@ 2015-06-18 00:39 ` Michael Paquier <michael.paquier@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Paquier @ 2015-06-18 00:39 UTC (permalink / raw)
To: digoal@126.com; +Cc: pgsql-bugs
On Wed, Jun 17, 2015 at 9:45 AM, <digoal@126.com> wrote:
> Allow pg_dump to share a snapshot taken by another session using --snapshot
> (Simon Riggs, Michael Paquier)
>
> The remote snapshot must have been exported by pg_export_snapshot() or been
> defined when creating a logical replication slot. This can be used by
> parallel pg_dump to use a consistent snapshot across pg_dump processes.
>
> There is no problem, But how to use a logical replication slot's snapshot?
> Now we must do it manual?
Or you can do it at application level with something able to maintain
alive the replication connection that created the logical replication
slot.
> Like this:
> pg95@db-172-16-3-150-> psql 'hostaddr=127.0.0.1 port=1922 user=postgres
> dbname=postgres replication=database'
> psql (9.5devel)
> Type "help" for help.
> postgres=# CREATE_REPLICATION_SLOT ab12 LOGICAL
> "/opt/pgsql9.5/lib/test_decoding.so";
> slot_name | consistent_point | snapshot_name | output_plugin
>
> -----------+------------------+---------------+------------------------------------
> ab12 | 7/77B59A00 | 00000736-1 |
> /opt/pgsql9.5/lib/test_decoding.so
> (1 row)
>
> pg95@db-172-16-3-150-> pg_dump --snapshot=00000736-1
Yep, that's it.
> And there is no document descript it.
> Another command pg_recvlogical also can use stream replication protocol to
> create slot,but it exit soon and no any snapshot info output to stdout, we
> can use log_replication_commands to trace the snapshot, but we can't use it
> because pg_recvlogical exit soon.
I concur that this is underdocumented. We could add a section
"External snapshots" or similar here:
http://www.postgresql.org/docs/devel/static/logicaldecoding.html
Thoughts?
> I think , pg_recvlogical can add option --wait-dump | --wait second for
> --create-slot, wait a moment or wait some body import the snapshot, then
> close it or send the next replication commands.
This looks like a solution for something that you could do with a
small tool, the point being to maintain the replication connection
alive until the dump is taken. Depending on your environment the
timeout would vary as well, so it does not look a solid solution to
me. Another solution may be to allow pg_recvlogical to run a custom
script while the replication connection is maintained alive by it to
be able to perform actions while the replication connection is on, but
I don't see that happen at least in 9.6.
Regards,
--
Michael
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-06-18 00:39 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 00:45 BUG #13448: DOC about : pg_dump use logical replication snapshot digoal@126.com
2015-06-18 00:39 ` Michael Paquier <michael.paquier@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox