timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.94k stars 883 forks source link

Fix locking issues with new PG minor releases #7466

Closed erimatnor closed 5 days ago

erimatnor commented 6 days ago

This change fixes the following:

Add tuple locks when disabling autovacuum

A previous commit (https://github.com/timescale/timescaledb/commit/cbfd386c63842cb2779a8b598048381eb75a7db2) disabled autovacuum for internal compressed relations when using Hypercore TAM, but it lacked the tuple locks when updated pg_class that are now required by recent PG versions.

Add the missing tuple locks to fix the issue. See commit https://github.com/timescale/timescaledb/commit/7e30ed65651ab5b0adee835f17829fa69a52382e for more information.

Remove lock check assertion for reorder

A previous commit (7e30ed6) added an assertion check to the reorder code's swap_relation_files to ensure that proper locks are held on the relations when updating their pg_class entries, per new requirements in recent PostgreSQL releases. However, this check failed because the function could be called on indexes as well as tables, and indexes have different locking requirements.

The assertions aren't strictly needed because heap_update() has a check of its own that will raise a warning if locking requirements are not met (assuming the code is compiled with assertions enabled).

Disable-check: force-changelog-file Disable-check: commit-count

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.12%. Comparing base (59f50f2) to head (9f6dd89). Report is 606 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7466 +/- ## ========================================== + Coverage 80.06% 82.12% +2.05% ========================================== Files 190 230 +40 Lines 37181 43095 +5914 Branches 9450 10830 +1380 ========================================== + Hits 29770 35392 +5622 - Misses 2997 3388 +391 + Partials 4414 4315 -99 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: