On 7/24/18, 8:07 PM, "Michael Paquier" <mich...@paquier.xyz> wrote: > Hm... I have not imagined this part but adding a new layer is sort of > ugly, and an extra one would be needed for CLUSTER as well, in which > case adding cluster-related logs into vacuum.c introduces a circular > dependency with cluster.c. What about just skipping this refactoring > and move to the point where CLUSTER also gains its log queries directly > in cluster_rel? VACUUM FULL is also not going to run for autovacuum, so > that's less confusion with IsAutoVacuumWorkerProcess().
Since vacuum_rel() already obtains an AccessExclusiveLock on the relation for VACUUM FULL, we might be able to skip altering cluster_rel(). I think we will need to alter it if we are going to add SKIP LOCKED to CLUSTER, though. Nathan