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.93k stars 882 forks source link

Fix crash when converting to Hypercore TAM #7467

Closed erimatnor closed 2 days ago

erimatnor commented 2 days ago

The tuple sort state used for compression was created with a reference to a tuple descriptor in a relcache entry. If this relcache entry is invalidated, the tuple sort state becomes corrupt. This caused occasional crashes when converting a chunk to using Hypercore TAM (i.e., compressing).

Fix this by always making a copy of the tuple descriptor when creating the tuple sort state.

Disable-check: force-changelog-file

codecov[bot] commented 2 days ago

Codecov Report

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

Project coverage is 82.16%. Comparing base (59f50f2) to head (f1d7bea). Report is 607 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7467 +/- ## ========================================== + Coverage 80.06% 82.16% +2.09% ========================================== Files 190 230 +40 Lines 37181 43096 +5915 Branches 9450 10830 +1380 ========================================== + Hits 29770 35410 +5640 - Misses 2997 3371 +374 + 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:

erimatnor commented 2 days ago

This fixes the CI crash we've seen occasionally.