File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/backend/replication/logical Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4141 * transactions we need Snapshots that see intermediate versions of the
4242 * catalog in a transaction. During normal operation this is achieved by using
4343 * CommandIds/cmin/cmax. The problem with that however is that for space
44- * efficiency reasons only one value of that is stored
45- * (cf. combocid.c). Since combo CIDs are only available in memory we log
46- * additional information which allows us to get the original (cmin, cmax)
47- * pair during visibility checks. Check the reorderbuffer.c's comment above
44+ * efficiency reasons, the cmin and cmax are not included in WAL records. We
45+ * cannot read the cmin/cmax from the tuple itself, either, because it is
46+ * reset on crash recovery. Even if we could, we could not decode combocids
47+ * which are only tracked in the original backend's memory. To work around
48+ * that, heapam writes an extra WAL record (XLOG_HEAP2_NEW_CID) every time a
49+ * catalog row is modified, which includes the cmin and cmax of the
50+ * tuple. During decoding, we insert the ctid->(cmin,cmax) mappings into the
51+ * reorder buffer, and use them at visibility checks instead of the cmin/cmax
52+ * on the tuple itself. Check the reorderbuffer.c's comment above
4853 * ResolveCminCmaxDuringDecoding() for details.
4954 *
5055 * To facilitate all this we need our own visibility routine, as the normal
You can’t perform that action at this time.
0 commit comments