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

Commit811969b

Browse files
committed
Allocate enough shared string memory for stats of auxiliary processes.
This fixes a bug whereby the st_appname, st_clienthostname, andst_activity_raw fields for auxiliary processes point beyond the end oftheir respective shared memory segments. As a result, the application_nameof a backend might show up as the client hostname of an auxiliary process.Backpatch to v10, where this bug was introduced, when the auxiliaryprocesses were added to the array.Author: Edmund HornerReviewed-by: Michael PaquierDiscussion:https://www.postgresql.org/message-id/CAMyN-kA7aOJzBmrYFdXcc7Z0NmW%2B5jBaf_m%3D_-77uRNyKC9r%3DA%40mail.gmail.com
1 parenta820b4c commit811969b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,7 +2650,7 @@ CreateSharedBackendStatus(void)
26502650
}
26512651

26522652
/* Create or attach to the shared appname buffer */
2653-
size=mul_size(NAMEDATALEN,MaxBackends);
2653+
size=mul_size(NAMEDATALEN,NumBackendStatSlots);
26542654
BackendAppnameBuffer= (char*)
26552655
ShmemInitStruct("Backend Application Name Buffer",size,&found);
26562656

@@ -2668,7 +2668,7 @@ CreateSharedBackendStatus(void)
26682668
}
26692669

26702670
/* Create or attach to the shared client hostname buffer */
2671-
size=mul_size(NAMEDATALEN,MaxBackends);
2671+
size=mul_size(NAMEDATALEN,NumBackendStatSlots);
26722672
BackendClientHostnameBuffer= (char*)
26732673
ShmemInitStruct("Backend Client Host Name Buffer",size,&found);
26742674

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp