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

Commit3daaa06

Browse files
author
Sokolov Yura
committed
cfs: fix cfs_control_gc_lock
it should wait always, not only first time.
1 parent1a281e8 commit3daaa06

File tree

1 file changed

+9
-12
lines changed
  • src/backend/storage/file

1 file changed

+9
-12
lines changed

‎src/backend/storage/file/cfs.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,20 +1481,17 @@ void cfs_gc_start_bgworkers()
14811481
voidcfs_control_gc_lock(void)
14821482
{
14831483
uint32was_disabled=pg_atomic_fetch_add_u32(&cfs_state->gc_disabled,1);
1484-
if (!was_disabled)
1484+
/* Wait until there are no active GC workers */
1485+
while (pg_atomic_read_u32(&cfs_state->n_active_gc)!=0)
14851486
{
1486-
/* Wait until there are no active GC workers */
1487-
while (pg_atomic_read_u32(&cfs_state->n_active_gc)!=0)
1488-
{
1489-
intrc=WaitLatch(MyLatch,
1490-
WL_LATCH_SET |WL_TIMEOUT |WL_POSTMASTER_DEATH,
1491-
CFS_DISABLE_TIMEOUT/* ms */);
1492-
if (rc&WL_POSTMASTER_DEATH)
1493-
exit(1);
1487+
intrc=WaitLatch(MyLatch,
1488+
WL_LATCH_SET |WL_TIMEOUT |WL_POSTMASTER_DEATH,
1489+
CFS_DISABLE_TIMEOUT/* ms */);
1490+
if (rc&WL_POSTMASTER_DEATH)
1491+
exit(1);
14941492

1495-
ResetLatch(MyLatch);
1496-
CHECK_FOR_INTERRUPTS();
1497-
}
1493+
ResetLatch(MyLatch);
1494+
CHECK_FOR_INTERRUPTS();
14981495
}
14991496
}
15001497

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp