Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax lock when updating job history information #7577

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented Jan 7, 2025

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.

Disable-check: force-changelog-file

@fabriziomello fabriziomello added bgw The background worker subsystem, including the scheduler locking jobs labels Jan 7, 2025
@fabriziomello fabriziomello self-assigned this Jan 7, 2025
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.35%. Comparing base (59f50f2) to head (031735e).
Report is 687 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7577      +/-   ##
==========================================
+ Coverage   80.06%   82.35%   +2.28%     
==========================================
  Files         190      238      +48     
  Lines       37181    43721    +6540     
  Branches     9450    10971    +1521     
==========================================
+ Hits        29770    36007    +6237     
- Misses       2997     3382     +385     
+ Partials     4414     4332      -82     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fabriziomello fabriziomello added this to the TimescaleDB 2.18.0 milestone Jan 8, 2025
@fabriziomello fabriziomello force-pushed the relax_job_history_lock branch 2 times, most recently from f029cf4 to 471f097 Compare January 8, 2025 16:35
In timescale#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.
@fabriziomello fabriziomello force-pushed the relax_job_history_lock branch from 471f097 to 031735e Compare January 8, 2025 19:08
@fabriziomello fabriziomello enabled auto-merge (rebase) January 8, 2025 19:08
@fabriziomello fabriziomello merged commit a03b43a into timescale:main Jan 8, 2025
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgw The background worker subsystem, including the scheduler jobs locking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants