@@ -133,8 +133,10 @@ WaitLSNSetLatch(void)
133
133
for (i = 0 ;i < (MaxConnections + 1 );i ++ )
134
134
{
135
135
SpinLockAcquire (& state -> l_arr [i ].slock );
136
- if (state -> l_arr [i ].pid != 0 )
136
+ if (state -> l_arr [i ].pid != 0 && !(TestLatch (& state -> l_arr [i ].latch )))
137
+ {
137
138
SetLatch (& state -> l_arr [i ].latch );
139
+ }
138
140
SpinLockRelease (& state -> l_arr [i ].slock );
139
141
}
140
142
}
@@ -151,9 +153,6 @@ WaitLSNUtility(const char *lsn, const int delay)
151
153
TimestampTz timer = GetCurrentTimestamp ();
152
154
153
155
trg_lsn = DatumGetLSN (DirectFunctionCall1 (pg_lsn_in ,CStringGetDatum (lsn )));
154
- //tdelay *= 1000;
155
-
156
- elog (LOG ,"ACHTUNG tdelay %u" ,tdelay );
157
156
158
157
if (delay > 0 )
159
158
latch_events = WL_LATCH_SET |WL_TIMEOUT |WL_POSTMASTER_DEATH ;
@@ -182,7 +181,6 @@ WaitLSNUtility(const char *lsn, const int delay)
182
181
break ;
183
182
TimestampDifference (timer ,GetCurrentTimestamp (),& secs ,& microsecs );
184
183
tdelay -= (secs * 1000 + microsecs /1000 );
185
- elog (LOG ,"ACHTUNG tdelay %u, %d" ,tdelay ,TimestampDifferenceExceeds (timer ,GetCurrentTimestamp (),tdelay ));
186
184
timer = GetCurrentTimestamp ();
187
185
}
188
186