|
18 | 18 | #include <math.h>
|
19 | 19 |
|
20 | 20 | #include "pgstat.h"
|
21 |
| -#include "fmgr.h" |
22 |
| -#include "access/transam.h" |
23 |
| -#include "access/xact.h" |
24 | 21 | #include "access/xlog.h"
|
25 |
| -#include "access/xlogdefs.h" |
26 | 22 | #include "access/xlogrecovery.h"
|
27 |
| -#include "catalog/pg_type.h" |
28 | 23 | #include "commands/waitlsn.h"
|
29 |
| -#include "executor/spi.h" |
30 | 24 | #include "funcapi.h"
|
31 | 25 | #include "miscadmin.h"
|
32 |
| -#include "storage/ipc.h" |
33 | 26 | #include "storage/latch.h"
|
34 |
| -#include "storage/pmsignal.h" |
35 | 27 | #include "storage/proc.h"
|
36 | 28 | #include "storage/shmem.h"
|
37 |
| -#include "storage/sinvaladt.h" |
38 |
| -#include "utils/builtins.h" |
39 | 29 | #include "utils/pg_lsn.h"
|
40 | 30 | #include "utils/snapmgr.h"
|
41 |
| -#include "utils/timestamp.h" |
42 | 31 | #include "utils/fmgrprotos.h"
|
| 32 | +#include "utils/wait_event_types.h" |
43 | 33 |
|
44 | 34 | /* Add to / delete from shared memory array */
|
45 | 35 | static void addLSNWaiter(XLogRecPtr lsn);
|
@@ -88,11 +78,11 @@ addLSNWaiter(XLogRecPtr lsn)
|
88 | 78 | WaitLSNProcInfo cur;
|
89 | 79 | int i;
|
90 | 80 |
|
91 |
| - SpinLockAcquire(&waitLSN->mutex); |
92 |
| - |
93 | 81 | cur.procnum = MyProcNumber;
|
94 | 82 | cur.waitLSN = lsn;
|
95 | 83 |
|
| 84 | + SpinLockAcquire(&waitLSN->mutex); |
| 85 | + |
96 | 86 | for (i = 0; i < waitLSN->numWaitedProcs; i++)
|
97 | 87 | {
|
98 | 88 | if (waitLSN->procInfos[i].waitLSN >= cur.waitLSN)
|
|
226 | 216 | WaitForLSN(XLogRecPtr targetLSN, int64 timeout)
|
227 | 217 | {
|
228 | 218 | XLogRecPtr currentLSN;
|
229 |
| - TimestampTz endtime; |
| 219 | + TimestampTz endtime = 0; |
230 | 220 |
|
231 | 221 | /* Shouldn't be called when shmem isn't initialized */
|
232 | 222 | Assert(waitLSN);
|
|
0 commit comments