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

Commitb4c19da

Browse files
committed
aio: Remove obsolete IO worker ID references.
In an ancient ancestor of this code, the postmaster assigned IDs to IOworkers. Now it tracks them in an unordered array and doesn't knowtheir IDs, so it might be confusing to readers that it still referred totheir indexes as IDs.No change in behavior, just variable name and error message cleanup.Back-patch to 18.Discussion:https://postgr.es/m/CA%2BhUKG%2BwbaZZ9Nwc_bTopm4f-7vDmCwLk80uKDHj9mq%2BUp0E%2Bg%40mail.gmail.com
1 parentb2afb06 commitb4c19da

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4337,15 +4337,15 @@ maybe_start_bgworkers(void)
43374337
staticbool
43384338
maybe_reap_io_worker(intpid)
43394339
{
4340-
for (intid=0;id<MAX_IO_WORKERS;++id)
4340+
for (inti=0;i<MAX_IO_WORKERS;++i)
43414341
{
4342-
if (io_worker_children[id]&&
4343-
io_worker_children[id]->pid==pid)
4342+
if (io_worker_children[i]&&
4343+
io_worker_children[i]->pid==pid)
43444344
{
4345-
ReleasePostmasterChildSlot(io_worker_children[id]);
4345+
ReleasePostmasterChildSlot(io_worker_children[i]);
43464346

43474347
--io_worker_count;
4348-
io_worker_children[id]=NULL;
4348+
io_worker_children[i]=NULL;
43494349
return true;
43504350
}
43514351
}
@@ -4389,22 +4389,22 @@ maybe_adjust_io_workers(void)
43894389
while (io_worker_count<io_workers)
43904390
{
43914391
PMChild*child;
4392-
intid;
4392+
inti;
43934393

43944394
/* find unused entry in io_worker_children array */
4395-
for (id=0;id<MAX_IO_WORKERS;++id)
4395+
for (i=0;i<MAX_IO_WORKERS;++i)
43964396
{
4397-
if (io_worker_children[id]==NULL)
4397+
if (io_worker_children[i]==NULL)
43984398
break;
43994399
}
4400-
if (id==MAX_IO_WORKERS)
4401-
elog(ERROR,"could not find a free IO workerID");
4400+
if (i==MAX_IO_WORKERS)
4401+
elog(ERROR,"could not find a free IO workerslot");
44024402

44034403
/* Try to launch one. */
44044404
child=StartChildProcess(B_IO_WORKER);
44054405
if (child!=NULL)
44064406
{
4407-
io_worker_children[id]=child;
4407+
io_worker_children[i]=child;
44084408
++io_worker_count;
44094409
}
44104410
else
@@ -4415,11 +4415,11 @@ maybe_adjust_io_workers(void)
44154415
if (io_worker_count>io_workers)
44164416
{
44174417
/* ask the IO worker in the highest slot to exit */
4418-
for (intid=MAX_IO_WORKERS-1;id >=0;--id)
4418+
for (inti=MAX_IO_WORKERS-1;i >=0;--i)
44194419
{
4420-
if (io_worker_children[id]!=NULL)
4420+
if (io_worker_children[i]!=NULL)
44214421
{
4422-
kill(io_worker_children[id]->pid,SIGUSR2);
4422+
kill(io_worker_children[i]->pid,SIGUSR2);
44234423
break;
44244424
}
44254425
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp