/* is somebody streaming out changes for this slot */
bool active;
+ /* any outstanding modifications? */
+ bool dirty;
+
+ /*
+ * For logical decoding, it's extremely important that we never remove any
+ * data that's still needed for decoding purposes, even after a crash;
+ * otherwise, decoding will produce wrong answers. Ordinary streaming
+ * replication also needs to prevent old row versions from being removed
+ * too soon, but the worst consequence we might encounter there is unwanted
+ * query cancellations on the standby. Thus, for logical decoding,
+ * this value represents the latest data_xmin that has actually been
+ * written to disk, whereas for streaming replication, it's just the
+ * same as the persistent value (data.data_xmin).
+ */
+ TransactionId effective_data_xmin;
+
/* data surviving shutdowns and crashes */
ReplicationSlotPersistentData data;
- /* in-memory xmin horizon, updated after syncing to disk, used for computations */
- TransactionId effective_data_xmin;
-
+
+ /* is somebody performing io on this slot? */
+ LWLock *io_in_progress_lock;
} ReplicationSlot;
/*