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

Commit8eccf76

Browse files
Improvements to ps message of startup process during Hot Standby.
Message is reset earlier and potential bug avoided.Andres Freund
1 parentdd428c7 commit8eccf76

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎src/backend/storage/ipc/standby.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.12 2010/02/1301:32:19 sriggs Exp $
14+
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.13 2010/02/1316:29:38 sriggs Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -164,6 +164,7 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
164164
ProcSignalReasonreason)
165165
{
166166
charwaitactivitymsg[100];
167+
charoldactivitymsg[101];
167168

168169
while (VirtualTransactionIdIsValid(*waitlist))
169170
{
@@ -186,17 +187,21 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
186187
TimestampDifference(waitStart,now,&wait_s,&wait_us);
187188
if (!logged&& (wait_s>0||wait_us>500000))
188189
{
189-
constchar*oldactivitymsg;
190+
constchar*oldactivitymsgp;
190191
intlen;
191192

192-
oldactivitymsg=get_ps_display(&len);
193+
oldactivitymsgp=get_ps_display(&len);
194+
195+
if (len>100)
196+
len=100;
197+
198+
memcpy(oldactivitymsg,oldactivitymsgp,len);
199+
oldactivitymsg[len]=0;
200+
193201
snprintf(waitactivitymsg,sizeof(waitactivitymsg),
194202
"waiting for max_standby_delay (%u s)",
195203
MaxStandbyDelay);
196204
set_ps_display(waitactivitymsg, false);
197-
if (len>100)
198-
len=100;
199-
memcpy(waitactivitymsg,oldactivitymsg,len);
200205

201206
pgstat_report_waiting(true);
202207

@@ -226,7 +231,7 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
226231
/* Reset ps display */
227232
if (logged)
228233
{
229-
set_ps_display(waitactivitymsg, false);
234+
set_ps_display(oldactivitymsg, false);
230235
pgstat_report_waiting(false);
231236
}
232237

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp