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

Commitaeabc16

Browse files
committed
When searching for backend status iterate over the index in the LocalPgBackendStatus array, not over BackendId for v16 or ProcNumber for 16+.
BackendId may not be equal to the index +1 in the LocalPgBackendStatus array as well as ProcNumber may not be equal the index.
1 parent25bd499 commitaeabc16

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎pg_query_state.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,16 @@ search_be_status(int pid)
365365

366366
for (beid=1;beid <=pgstat_fetch_stat_numbackends();beid++)
367367
{
368-
#ifPG_VERSION_NUM >=170000
369-
PgBackendStatus*be_status=pgstat_get_beentry_by_proc_number(beid);
370-
#elifPG_VERSION_NUM >=160000
371-
PgBackendStatus*be_status=pgstat_get_beentry_by_backend_id(beid);
368+
#ifPG_VERSION_NUM >=160000
369+
LocalPgBackendStatus*lbe_status=pgstat_get_local_beentry_by_index(beid);
370+
PgBackendStatus*be_status;
371+
372+
Assert(lbe_status);
373+
#ifndefPGPRO_STD
374+
be_status=&lbe_status->backendStatus;
375+
#else
376+
be_status=lbe_status->backendStatus;
377+
#endif
372378
#else
373379
PgBackendStatus*be_status=pgstat_fetch_stat_beentry(beid);
374380
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp