Skip to content

Commit 349c20b

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

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/backend/utils/time/snapmgr.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,9 @@ typedef struct SerializedSnapshotData
197197
TimestampTz whenTaken;
198198
XLogRecPtr lsn;
199199
CSNSnapshotData csnSnapshotData;
200-
uint64 undoRegularLocation;
201-
uint64 undoRegularXmin;
200+
uint64 undoRegularRowLocation;
201+
uint64 undoRegularPageLocation;
202202
uint64 undoSystemLocation;
203-
uint64 undoSystemXmin;
204203
} SerializedSnapshotData;
205204

206205
Size
@@ -2198,9 +2197,8 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
21982197
serialized_snapshot.csnSnapshotData.xmin = snapshot->csnSnapshotData.xmin;
21992198
serialized_snapshot.csnSnapshotData.snapshotcsn = snapshot->csnSnapshotData.snapshotcsn;
22002199
serialized_snapshot.csnSnapshotData.xlogptr = snapshot->csnSnapshotData.xlogptr;
2201-
serialized_snapshot.undoRegularXmin = snapshot->undoRegularLocationPhNode.xmin;
2202-
serialized_snapshot.undoRegularLocation = snapshot->undoRegularLocationPhNode.undoLocation;
2203-
serialized_snapshot.undoSystemXmin = snapshot->undoSystemLocationPhNode.xmin;
2200+
serialized_snapshot.undoRegularRowLocation = snapshot->undoRegularRowLocationPhNode.undoLocation;
2201+
serialized_snapshot.undoRegularPageLocation = snapshot->undoRegularPageLocationPhNode.undoLocation;
22042202
serialized_snapshot.undoSystemLocation = snapshot->undoSystemLocationPhNode.undoLocation;
22052203

22062204
/*
@@ -2280,9 +2278,8 @@ RestoreSnapshot(char *start_address)
22802278
snapshot->csnSnapshotData.xmin = serialized_snapshot.csnSnapshotData.xmin;
22812279
snapshot->csnSnapshotData.snapshotcsn = serialized_snapshot.csnSnapshotData.snapshotcsn;
22822280
snapshot->csnSnapshotData.xlogptr = serialized_snapshot.csnSnapshotData.xlogptr;
2283-
snapshot->undoRegularLocationPhNode.xmin = serialized_snapshot.undoRegularXmin;
2284-
snapshot->undoRegularLocationPhNode.undoLocation = serialized_snapshot.undoRegularLocation;
2285-
snapshot->undoSystemLocationPhNode.xmin = serialized_snapshot.undoSystemXmin;
2281+
snapshot->undoRegularRowLocationPhNode.undoLocation = serialized_snapshot.undoRegularRowLocation;
2282+
snapshot->undoRegularPageLocationPhNode.undoLocation = serialized_snapshot.undoRegularPageLocation;
22862283
snapshot->undoSystemLocationPhNode.undoLocation = serialized_snapshot.undoSystemLocation;
22872284

22882285
/* Copy XIDs, if present. */

src/include/utils/snapshot.h

Lines changed: 2 additions & 2 deletions
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)