34
34
#include "access/xlog.h"
35
35
#include "access/xlogdefs.h"
36
36
#include "commands/waitlsn.h"
37
-
37
+ #include "storage/proc.h"
38
+ #include "access/transam.h"
38
39
39
40
/* Latches Own-DisownLatch and AbortCаllBack */
40
41
static uint32 GetSHMEMSize (void );
@@ -134,9 +135,7 @@ WaitLSNSetLatch(void)
134
135
{
135
136
SpinLockAcquire (& state -> l_arr [i ].slock );
136
137
if (state -> l_arr [i ].pid != 0 )
137
- {
138
138
SetLatch (& state -> l_arr [i ].latch );
139
- }
140
139
SpinLockRelease (& state -> l_arr [i ].slock );
141
140
}
142
141
}
@@ -163,7 +162,6 @@ WaitLSNUtility(const char *lsn, const int delay)
163
162
164
163
for (;;)
165
164
{
166
- ResetLatch (& state -> l_arr [MyBackendId ].latch );
167
165
cur_lsn = GetXLogReplayRecPtr (NULL );
168
166
169
167
/* If LSN had been Replayed */
@@ -183,10 +181,11 @@ WaitLSNUtility(const char *lsn, const int delay)
183
181
tdelay -= (secs * 1000 + microsecs /1000 );
184
182
timer = GetCurrentTimestamp ();
185
183
}
186
-
187
- /* Tom Lane insists on! Discussion: <1661(dot)1469996911(at)sss(dot)pgh(dot)pa(dot)us> */
188
- CHECK_FOR_INTERRUPTS ();
184
+ MyPgXact -> xmin = InvalidTransactionId ;
189
185
WaitLatch (& state -> l_arr [MyBackendId ].latch , latch_events , tdelay );
186
+ ResetLatch (& state -> l_arr [MyBackendId ].latch );
187
+ CHECK_FOR_INTERRUPTS ();
188
+
190
189
}
191
190
192
191
WLDisownLatch ();
0 commit comments