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

Commit20b8b5d

Browse files
committed
Fix stale idle flag when IO workers exit.
Otherwise we could choose a worker that has exited and crash whiletrying to wake it up.Back-patch to 18.Reported-by: Tomas Vondra <tomas@vondra.me>Reported-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/t5aqjhkj6xdkido535pds7fk5z4finoxra4zypefjqnlieevbg%40357aaf6u525j
1 parentccacaf4 commit20b8b5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/backend/storage/aio/method_worker.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ pgaio_choose_idle_worker(void)
172172
/* Find the lowest bit position, and clear it. */
173173
worker=pg_rightmost_one_pos64(io_worker_control->idle_worker_mask);
174174
io_worker_control->idle_worker_mask &= ~(UINT64_C(1) <<worker);
175+
Assert(io_worker_control->workers[worker].in_use);
175176

176177
returnworker;
177178
}
@@ -316,6 +317,7 @@ pgaio_worker_die(int code, Datum arg)
316317
Assert(io_worker_control->workers[MyIoWorkerId].in_use);
317318
Assert(io_worker_control->workers[MyIoWorkerId].latch==MyLatch);
318319

320+
io_worker_control->idle_worker_mask &= ~(UINT64_C(1) <<MyIoWorkerId);
319321
io_worker_control->workers[MyIoWorkerId].in_use= false;
320322
io_worker_control->workers[MyIoWorkerId].latch=NULL;
321323
LWLockRelease(AioWorkerSubmissionQueueLock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp