Re: DataChecksumsStateStruct cost_delay fields and locking

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-17T18:12:42Z
Lists: pgsql-hackers
On 17/06/2026 16:04, Daniel Gustafsson wrote:
> All comments addressed in the attached.

Thanks, LGTM.

> @@ -1533,9 +1532,13 @@ DataChecksumsWorkerMain(Datum arg)
>  	/*
>  	 * Get a list of all temp tables present as we start in this database. We
>  	 * need to wait until they are all gone until we are done, since we cannot
> -	 * access these relations and modify them.
> +	 * access these relations and modify them.  For the list of relations to
> +	 * process once the temp relations are gone, check if shared catalogs have
> +	 * been processed already.
>  	 */
>  	InitialTempTableList = BuildRelationList(true, false);
> +	LWLockAcquire(DataChecksumsWorkerLock, LW_EXCLUSIVE);
> +	process_shared = DataChecksumState->process_shared_catalogs;
>  
>  	/*
>  	 * Enable vacuum cost delay, if any.  While this process isn't doing any

Not new with this patch, but caught my eye now: the double "until" in 
the phrase "We need to wait until they are all gone until we are done" 
sounds a little awkward. I had to read it a few times to parse it right. 
I'd suggest "We need to wait until they are all gone before we exit" or 
something like that.

- Heikki




Commits

  1. Fix comments on data checksum cost settings