Skip to content

Commit cb493eb

Browse files
committed
Update SnapshotData: split row-level and page-level undo locations
Also, get xmin out of RetainUndoLocationPHNode.
1 parent ba8e624 commit cb493eb

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/backend/utils/time/snapmgr.c

+6-9
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,9 @@ typedef struct SerializedSnapshotData
206206
TimestampTz whenTaken;
207207
XLogRecPtr lsn;
208208
CSNSnapshotData csnSnapshotData;
209-
uint64 undoRegularLocation;
210-
uint64 undoRegularXmin;
209+
uint64 undoRegularRowLocation;
210+
uint64 undoRegularPageLocation;
211211
uint64 undoSystemLocation;
212-
uint64 undoSystemXmin;
213212
} SerializedSnapshotData;
214213

215214
/*
@@ -1767,9 +1766,8 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
17671766
serialized_snapshot.csnSnapshotData.xmin = snapshot->csnSnapshotData.xmin;
17681767
serialized_snapshot.csnSnapshotData.snapshotcsn = snapshot->csnSnapshotData.snapshotcsn;
17691768
serialized_snapshot.csnSnapshotData.xlogptr = snapshot->csnSnapshotData.xlogptr;
1770-
serialized_snapshot.undoRegularXmin = snapshot->undoRegularLocationPhNode.xmin;
1771-
serialized_snapshot.undoRegularLocation = snapshot->undoRegularLocationPhNode.undoLocation;
1772-
serialized_snapshot.undoSystemXmin = snapshot->undoSystemLocationPhNode.xmin;
1769+
serialized_snapshot.undoRegularRowLocation = snapshot->undoRegularRowLocationPhNode.undoLocation;
1770+
serialized_snapshot.undoRegularPageLocation = snapshot->undoRegularPageLocationPhNode.undoLocation;
17731771
serialized_snapshot.undoSystemLocation = snapshot->undoSystemLocationPhNode.undoLocation;
17741772

17751773
/*
@@ -1849,9 +1847,8 @@ RestoreSnapshot(char *start_address)
18491847
snapshot->csnSnapshotData.xmin = serialized_snapshot.csnSnapshotData.xmin;
18501848
snapshot->csnSnapshotData.snapshotcsn = serialized_snapshot.csnSnapshotData.snapshotcsn;
18511849
snapshot->csnSnapshotData.xlogptr = serialized_snapshot.csnSnapshotData.xlogptr;
1852-
snapshot->undoRegularLocationPhNode.xmin = serialized_snapshot.undoRegularXmin;
1853-
snapshot->undoRegularLocationPhNode.undoLocation = serialized_snapshot.undoRegularLocation;
1854-
snapshot->undoSystemLocationPhNode.xmin = serialized_snapshot.undoSystemXmin;
1850+
snapshot->undoRegularRowLocationPhNode.undoLocation = serialized_snapshot.undoRegularRowLocation;
1851+
snapshot->undoRegularPageLocationPhNode.undoLocation = serialized_snapshot.undoRegularPageLocation;
18551852
snapshot->undoSystemLocationPhNode.undoLocation = serialized_snapshot.undoSystemLocation;
18561853

18571854
/* Copy XIDs, if present. */

src/include/utils/snapshot.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ typedef struct SnapshotData *Snapshot;
125125
typedef struct
126126
{
127127
uint64 undoLocation; /* undo log location retained by this snapshot */
128-
uint64 xmin;
129128
pairingheap_node ph_node;
130129
} RetainUndoLocationPHNode;
131130

@@ -229,7 +228,8 @@ typedef struct SnapshotData
229228
*/
230229
uint64 snapXactCompletionCount;
231230

232-
RetainUndoLocationPHNode undoRegularLocationPhNode;
231+
RetainUndoLocationPHNode undoRegularRowLocationPhNode;
232+
RetainUndoLocationPHNode undoRegularPageLocationPhNode;
233233
RetainUndoLocationPHNode undoSystemLocationPhNode;
234234
CSNSnapshotData csnSnapshotData;
235235
} SnapshotData;

0 commit comments

Comments
 (0)