From f029cf443f68a965aa6280eff4be8f65dcb0d073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADzio=20de=20Royes=20Mello?= Date: Tue, 7 Jan 2025 18:39:44 -0300 Subject: [PATCH] Relax lock when updating job history information In #6767 we introduced the ability to track job execution history, but looks like we exaggerated the lock level when marking the end of the job execution using `ShareRowExclusiveLock` that conflicts with autovacuum jobs that requires an `ShareUpdateExclusiveLock`, so relaxing the lock to `RowExclusiveLock` because we only update the tuple in the job execution history metadata table. --- src/bgw/job_stat_history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bgw/job_stat_history.c b/src/bgw/job_stat_history.c index c71b9c51e4f..2a0401cd66e 100644 --- a/src/bgw/job_stat_history.c +++ b/src/bgw/job_stat_history.c @@ -270,7 +270,7 @@ ts_bgw_job_stat_history_mark_end(BgwJob *job, JobResult result, Jsonb *edata) bgw_job_stat_history_tuple_mark_end, NULL, &context, - ShareRowExclusiveLock)) + RowExclusiveLock)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unable to find job history " INT64_FORMAT, new_job->job_history.id)));