]> granicus.if.org Git - postgresql/commit
Properly re-initialize replication slot shared memory upon creation.
authorAndres Freund <andres@anarazel.de>
Wed, 17 Aug 2016 20:15:03 +0000 (13:15 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 17 Aug 2016 20:15:03 +0000 (13:15 -0700)
commit8cb23dba8d75d9be8f1cc58bdfcbcd8e410be39a
treeab855440e7af24d1af13d9364ea7677cfb2a1582
parentd715b76d12fa516370ce0b56a708fe1521605b66
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
src/backend/replication/slot.c