pgsql: Properly re-initialize replication slot shared memory upon creat - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Properly re-initialize replication slot shared memory upon creat
Date
Msg-id E1ba7ME-00065g-TG@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Properly re-initialize replication slot shared memory upon creation.

Slot creation did not clear all fields upon creation. After start the
memory is zeroed, but when a physical replication slot was created in
the shared memory of a previously existing logical slot, catalog_xmin
would not be cleared. That in turn would prevent vacuum from doing its
duties.

To fix initialize all the fields. To make similar future bugs less
likely, zero all of ReplicationSlotPersistentData, and re-order the
rest of the initialization to be in struct member order.

Analysis: Andrew Gierth
Reported-By: md@chewy.com
Author: Michael Paquier
Discussion: <20160705173502.1398.70934@wrigleys.postgresql.org>
Backpatch: 9.4, where replication slots were introduced

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2d7e591007a6f44e5e27e2b6c1098483105c0d10

Modified Files
--------------
src/backend/replication/slot.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Properly re-initialize replication slot shared memory upon creat
Next
From: Tom Lane
Date:
Subject: pgsql: Implement regexp_match(), a simplified alternative to regexp_mat