*/
Assert(!slot->in_use);
Assert(slot->active_pid == 0);
- slot->data.persistency = persistency;
- slot->data.xmin = InvalidTransactionId;
- slot->effective_xmin = InvalidTransactionId;
+
+ /* first initialize persistent data */
+ memset(&slot->data, 0, sizeof(ReplicationSlotPersistentData));
StrNCpy(NameStr(slot->data.name), name, NAMEDATALEN);
slot->data.database = db_specific ? MyDatabaseId : InvalidOid;
- slot->data.restart_lsn = InvalidXLogRecPtr;
+ slot->data.persistency = persistency;
+
+ /* and then data only present in shared memory */
+ slot->just_dirtied = false;
+ slot->dirty = false;
+ slot->effective_xmin = InvalidTransactionId;
+ slot->effective_catalog_xmin = InvalidTransactionId;
+ slot->candidate_catalog_xmin = InvalidTransactionId;
+ slot->candidate_xmin_lsn = InvalidXLogRecPtr;
+ slot->candidate_restart_valid = InvalidXLogRecPtr;
+ slot->candidate_restart_lsn = InvalidXLogRecPtr;
/*
* Create the slot on disk. We haven't actually marked the slot allocated