[PATCH] Logical decoding support for sequence advances

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, konstantin knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Subject: [PATCH] Logical decoding support for sequence advances
Date: 2015-12-14 03:28:51
Message-ID: CAMsr+YGez7Wi+zjKPs2mtV1EzQa8oWu595esdveTkbshbQDWmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all

Attached is a patch against 9.6 to add support for informing logical
decoding plugins of the new sequence last_value when sequence advance WAL
records are processed during decoding.

The primary purpose is to make logical replication based failover practical
in 9.6 by ensuring that the downstream's sequence positions are always
ahead of the upstream's. It's replicating the crash-recovery sequence
positions, basically.

This isn't as flexible as a full sequence access method but it's simple,
unintrusive and it gets things done now.

test_decoding is updated to reflect the change and test the functionality.
The large diff is mainly a result of that, since the output is a bit
spammy.

Pushed to https://github.com/2ndQuadrant/postgres/tree/dev/decode-sequences
.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Logical-decoding-for-sequence-advances.patch text/x-patch 400.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2015-12-14 03:31:58 Re: Using quicksort for every external sort run
Previous Message Tom Lane 2015-12-14 03:27:31 Re: Disabling an index temporarily