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

Commitf6b8f19

Browse files
Allocate access strategy in parallel VACUUM workers.
Commit49f49de took entirely the wrong approach to fixing this issue.Just allocate a local buffer access strategy in each individual workerinstead of trying to propagate state. This state was never propagatedby parallel VACUUM in the first place.It looks like the only reason that this worked following commit40d964ewas that it involved static global variables, which are initialized to 0per the C standard.A more comprehensive fix may be necessary, even on HEAD. This fixshould at least get the buildfarm green once again.Thanks once again to Thomas Munro for continued off-list assistance withthe issue.
1 parent09c1c6a commitf6b8f19

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

‎src/backend/access/heap/vacuumlazy.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ typedef struct LVShared
194194
Oidrelid;
195195
intelevel;
196196

197-
/*
198-
* Buffer access strategy from leader
199-
*/
200-
BufferAccessStrategybstrategy;
201-
202197
/*
203198
* An indication for vacuum workers to perform either index vacuum or
204199
* index cleanup. first_time is true only if for_cleanup is true and
@@ -3485,7 +3480,6 @@ begin_parallel_vacuum(LVRelState *vacrel, BlockNumber nblocks,
34853480
MemSet(shared,0,est_shared);
34863481
shared->relid=RelationGetRelid(vacrel->rel);
34873482
shared->elevel=elevel;
3488-
shared->bstrategy=vacrel->bstrategy;
34893483
shared->maintenance_work_mem_worker=
34903484
(nindexes_mwm>0) ?
34913485
maintenance_work_mem /Min(parallel_workers,nindexes_mwm) :
@@ -3726,7 +3720,8 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
37263720
vacrel.rel=rel;
37273721
vacrel.indrels=indrels;
37283722
vacrel.nindexes=nindexes;
3729-
vacrel.bstrategy=lvshared->bstrategy;
3723+
/* Each parallel VACUUM worker gets its own access strategy */
3724+
vacrel.bstrategy=GetAccessStrategy(BAS_VACUUM);
37303725
vacrel.indstats= (IndexBulkDeleteResult**)
37313726
palloc0(nindexes*sizeof(IndexBulkDeleteResult*));
37323727

@@ -3765,6 +3760,7 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
37653760

37663761
vac_close_indexes(nindexes,indrels,RowExclusiveLock);
37673762
table_close(rel,ShareUpdateExclusiveLock);
3763+
FreeAccessStrategy(vacrel.bstrategy);
37683764
pfree(vacrel.indstats);
37693765
}
37703766

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp