pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix slot data persistency when advancing physical replication sl
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix slot data persistency when advancing physical replication sl
@ 2020-01-30 02:18  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2020-01-30 02:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix slot data persistency when advancing physical replication slots

Advancing a physical replication slot with pg_replication_slot_advance()
did not mark the slot as dirty if any advancing was done, preventing the
follow-up checkpoint to flush the slot data to disk.  This caused the
advancing to be lost even on clean restarts.  This does not happen for
logical slots as any advancing marked the slot as dirty.  Per
discussion, the original feature has been implemented so as in the event
of a crash the slot may move backwards to a past LSN.  This property is
kept and more documentation is added about that.

This commit adds some new TAP tests to check the persistency of physical
and logical slots after advancing across clean restarts.

Author: Alexey Kondratov, Michael Paquier
Reviewed-by: Andres Freund, Kyotaro Horiguchi, Craig Ringer
Discussion: https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ru
Backpatch-through: 11

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b0afdcad21fde1470e6502a376bfaf0e10d384fa

Modified Files
--------------
doc/src/sgml/func.sgml                      |  7 +++++--
src/backend/replication/slotfuncs.c         | 23 +++++++++++------------
src/test/recovery/t/001_stream_rep.pl       | 27 ++++++++++++++++++++++++++-
src/test/recovery/t/006_logical_decoding.pl | 26 +++++++++++++++++++++++++-
4 files changed, 67 insertions(+), 16 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix slot data persistency when advancing physical replication sl
@ 2020-01-30 02:18  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2020-01-30 02:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix slot data persistency when advancing physical replication slots

Advancing a physical replication slot with pg_replication_slot_advance()
did not mark the slot as dirty if any advancing was done, preventing the
follow-up checkpoint to flush the slot data to disk.  This caused the
advancing to be lost even on clean restarts.  This does not happen for
logical slots as any advancing marked the slot as dirty.  Per
discussion, the original feature has been implemented so as in the event
of a crash the slot may move backwards to a past LSN.  This property is
kept and more documentation is added about that.

This commit adds some new TAP tests to check the persistency of physical
and logical slots after advancing across clean restarts.

Author: Alexey Kondratov, Michael Paquier
Reviewed-by: Andres Freund, Kyotaro Horiguchi, Craig Ringer
Discussion: https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ru
Backpatch-through: 11

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3228512b7b2b6767b5f34768a958ed812118aa4d

Modified Files
--------------
doc/src/sgml/func.sgml                      |  7 +++++--
src/backend/replication/slotfuncs.c         | 23 +++++++++++------------
src/test/recovery/t/001_stream_rep.pl       | 27 ++++++++++++++++++++++++++-
src/test/recovery/t/006_logical_decoding.pl | 26 +++++++++++++++++++++++++-
4 files changed, 67 insertions(+), 16 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix slot data persistency when advancing physical replication sl
@ 2020-01-30 02:18  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2020-01-30 02:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix slot data persistency when advancing physical replication slots

Advancing a physical replication slot with pg_replication_slot_advance()
did not mark the slot as dirty if any advancing was done, preventing the
follow-up checkpoint to flush the slot data to disk.  This caused the
advancing to be lost even on clean restarts.  This does not happen for
logical slots as any advancing marked the slot as dirty.  Per
discussion, the original feature has been implemented so as in the event
of a crash the slot may move backwards to a past LSN.  This property is
kept and more documentation is added about that.

This commit adds some new TAP tests to check the persistency of physical
and logical slots after advancing across clean restarts.

Author: Alexey Kondratov, Michael Paquier
Reviewed-by: Andres Freund, Kyotaro Horiguchi, Craig Ringer
Discussion: https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ru
Backpatch-through: 11

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/374464c3e96fe3d55dc82a8417b034de14222a0b

Modified Files
--------------
doc/src/sgml/func.sgml                      |  7 +++++--
src/backend/replication/slotfuncs.c         | 23 +++++++++++------------
src/test/recovery/t/001_stream_rep.pl       | 27 ++++++++++++++++++++++++++-
src/test/recovery/t/006_logical_decoding.pl | 26 +++++++++++++++++++++++++-
4 files changed, 67 insertions(+), 16 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-01-30 02:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 02:18 pgsql: Fix slot data persistency when advancing physical replication sl Michael Paquier <michael@paquier.xyz>
2020-01-30 02:18 pgsql: Fix slot data persistency when advancing physical replication sl Michael Paquier <michael@paquier.xyz>
2020-01-30 02:18 pgsql: Fix slot data persistency when advancing physical replication sl Michael Paquier <michael@paquier.xyz>

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