Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5a4bfb

Browse files
Fenimorkindmpgpro
authored andcommitted
FIX
1 parent3b66506 commite5a4bfb

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

‎src/backend/commands/waitlsn.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,18 @@ WaitLSNSetLatch(void)
142142
void
143143
WaitLSNUtility(constchar*lsn,constintdelay)
144144
{
145-
XLogRecPtrtrg_lsn;
146-
XLogRecPtrcur_lsn;
147-
intlatch_events;
148-
inttdelay=delay;
149-
TimestampTztimer=GetCurrentTimestamp();
145+
XLogRecPtrtrg_lsn;
146+
XLogRecPtrcur_lsn;
147+
intlatch_events;
148+
uint_fast64_ttdelay=delay;
149+
longsecs;
150+
intmicrosecs;
151+
TimestampTztimer=GetCurrentTimestamp();
152+
150153
trg_lsn=DatumGetLSN(DirectFunctionCall1(pg_lsn_in,CStringGetDatum(lsn)));
154+
//tdelay *= 1000;
151155

152-
tdelay *=1000;
156+
elog(LOG,"ACHTUNG tdelay %u",tdelay);
153157

154158
if (delay>0)
155159
latch_events=WL_LATCH_SET |WL_TIMEOUT |WL_POSTMASTER_DEATH;
@@ -174,9 +178,11 @@ WaitLSNUtility(const char *lsn, const int delay)
174178
/* If Delay time is over */
175179
if (latch_events&WL_TIMEOUT)
176180
{
177-
tdelay-= (GetCurrentTimestamp()-timer);
178-
if (tdelay <=0)
181+
if (TimestampDifferenceExceeds(timer,GetCurrentTimestamp(),tdelay))
179182
break;
183+
TimestampDifference(timer,GetCurrentTimestamp(),&secs,&microsecs);
184+
tdelay-= (secs*1000+microsecs/1000);
185+
elog(LOG,"ACHTUNG tdelay %u, %d",tdelay,TimestampDifferenceExceeds(timer,GetCurrentTimestamp(),tdelay));
180186
timer=GetCurrentTimestamp();
181187
}
182188

‎src/backend/tcop/utility.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ standard_ProcessUtility(Node *parsetree,
913913
"WaitLSN")));
914914
}
915915
else
916-
WaitLSNUtility(stmt->lsn,*stmt->delay);
916+
WaitLSNUtility(stmt->lsn,stmt->delay);
917917
}
918918
break;
919919

‎src/include/nodes/parsenodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,7 @@ typedef struct WaitLSNStmt
31153115
{
31163116
NodeTagtype;
31173117
char*lsn;/* Taraget LSN to wait for */
3118-
int*delay;/* Delay to wait for LSN*/
3118+
intdelay;/* Delay to wait for LSN*/
31193119
}WaitLSNStmt;
31203120

31213121
#endif/* PARSENODES_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp