File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,25 @@ dtm_global_transaction(PG_FUNCTION_ARGS)
120
120
Datum
121
121
dtm_get_snapshot (PG_FUNCTION_ARGS )
122
122
{
123
+ TransationIn xmin ;
123
124
DtmEnsureConnection ();
124
- DtmGlobalGetSnapshot (DtmConn , GetCurrentTransactionId ());
125
+ DtmGlobalGetSnapshot (DtmConn , GetCurrentTransactionId (), & DtmSnapshot );
126
+ /* Move it to DtmGlobalGetSnapshot? */
127
+ xmin = DtmSnapshot .xmin ;
128
+ if (xmin != InvalidTransactionId ) {
129
+ xmin -= vacuum_defer_cleanup_age ;
130
+ if (!TransactionIdIsNormal (xmin )) {
131
+ xmin = FirstNormalTransactionId ;
132
+ }
133
+ if (RecentGlobalDataXmin > xmin ) {
134
+ RecentGlobalDataXmin = xmin ;
135
+ }
136
+ if (RecentGlobalXmin > xmin ) {
137
+ RecentGlobalXmin = xmin ;
138
+ }
139
+ RecentXmin = xmin ;
140
+ }
141
+ snapshot -> curcid = GetCurrentCommandId (false);
125
142
DtmHasSnapshot = true;
126
143
PG_RETURN_VOID ();
127
144
}
You can’t perform that action at this time.
0 commit comments