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

Commita18bc40

Browse files
committed
Do not stop CFS GC in case of errors
1 parentfe395b3 commita18bc40

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,13 +1107,22 @@ static void cfs_gc_bgworker_main(Datum arg)
11071107

11081108
elog(INFO,"Start CFS garbage collector %d",MyProcPid);
11091109

1110-
while (cfs_gc_scan_tablespace(worker_id)
1111-
&& !cfs_gc_stop
1112-
&&--cfs_state->max_iterations >=0)
1110+
while (true)
11131111
{
1114-
intrc=WaitLatch(MyLatch,
1115-
WL_TIMEOUT |WL_POSTMASTER_DEATH,
1116-
cfs_gc_period/* ms */ );
1112+
inttimeout=cfs_gc_period;
1113+
intrc;
1114+
1115+
if (!cfs_gc_scan_tablespace(worker_id))
1116+
{
1117+
timeout=CFS_RETRY_TIMEOUT;
1118+
}
1119+
if (cfs_gc_stop||--cfs_state->max_iterations <=0)
1120+
{
1121+
break;
1122+
}
1123+
rc=WaitLatch(MyLatch,
1124+
WL_TIMEOUT |WL_POSTMASTER_DEATH,
1125+
timeout/* ms */ );
11171126
if (rc&WL_POSTMASTER_DEATH)
11181127
exit(1);
11191128
}

‎src/include/storage/cfs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
#defineCFS_GC_LOCK 0x10000000
1212

13-
#defineCFS_LOCK_MIN_TIMEOUT 100/* microseconds */
13+
#defineCFS_LOCK_MIN_TIMEOUT 100/* microseconds: initial timeout of GC lock acquisition */
1414
#defineCFS_LOCK_MAX_TIMEOUT 10000/* microseconds */
15-
#defineCFS_DISABLE_TIMEOUT 1000/* milliseconds */
15+
#defineCFS_DISABLE_TIMEOUT 1000/* milliseconds: timeout of waiting for enabling GC */
16+
#defineCFS_RETRY_TIMEOUT 10000/* milliseconds: delay between GC iterations in case of error */
1617
#defineCFS_ESTIMATE_PROBES 10
1718

1819
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp