Properly re-initialize replication slot shared memory upon creation.
authorAndres Freund
Wed, 17 Aug 2016 20:15:04 +0000 (13:15 -0700)
committerAndres Freund
Wed, 17 Aug 2016 20:15:04 +0000 (13:15 -0700)
commit690a2fb90ef47a3a0750b70e2abf13bbb82466ff
tree767a2c3bbcadb96f27be310f6376dd96590f3fd7
parent3fa8ec44d1b95a7ee16a43e32d2bebcdd8b54a77
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: [email protected]
Author: Michael Paquier
Discussion: <20160705173502[email protected]>
Backpatch: 9.4, where replication slots were introduced
src/backend/replication/slot.c