Skip to content

Commit

Permalink
Relax lock when updating job history information
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fabriziomello committed Jan 8, 2025
1 parent 35839f9 commit f029cf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bgw/job_stat_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit f029cf4

Please sign in to comment.