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

Commit2bc2af9

Browse files
author
Sokolov Yura
committed
cfs: fix interaction of 'vacuum full', 'drop table' and cfs_gc.
1 parent05449c2 commit2bc2af9

File tree

1 file changed

+25
-5
lines changed
  • src/backend/storage/smgr

1 file changed

+25
-5
lines changed

‎src/backend/storage/smgr/md.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
451451
void
452452
mdunlink(RelFileNodeBackendrnode,ForkNumberforkNum,boolisRedo)
453453
{
454+
boolcfs_gc_locked= false;
454455
/*
455456
* We have to clean out any pending fsync requests for the doomed
456457
* relation, else the next mdsync() will fail. There can't be any such
@@ -461,14 +462,33 @@ mdunlink(RelFileNodeBackend rnode, ForkNumber forkNum, bool isRedo)
461462
if (!RelFileNodeBackendIsTemp(rnode))
462463
ForgetRelationFsyncRequests(rnode.node,forkNum);
463464

464-
/* Now do the per-fork work */
465-
if (forkNum==InvalidForkNumber)
465+
if (md_use_compression(rnode,forkNum==InvalidForkNumber ?MAIN_FORKNUM :forkNum))
466466
{
467-
for (forkNum=0;forkNum <=MAX_FORKNUM;forkNum++)
467+
cfs_gc_locked= true;
468+
cfs_control_gc_lock();
469+
}
470+
471+
PG_TRY();
472+
{
473+
/* Now do the per-fork work */
474+
if (forkNum==InvalidForkNumber)
475+
{
476+
for (forkNum=0;forkNum <=MAX_FORKNUM;forkNum++)
477+
mdunlinkfork(rnode,forkNum,isRedo);
478+
}
479+
else
468480
mdunlinkfork(rnode,forkNum,isRedo);
481+
}
469482
}
470-
else
471-
mdunlinkfork(rnode,forkNum,isRedo);
483+
PG_CATCH();
484+
{
485+
if (cfs_gc_locked)
486+
cfs_control_gc_unlock();
487+
PG_RE_THROW();
488+
}
489+
PG_END_TRY();
490+
if (cfs_gc_locked)
491+
cfs_control_gc_unlock();
472492
}
473493

474494
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp