-
Notifications
You must be signed in to change notification settings - Fork 916
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
Fix lock order when dropping index #7600
Conversation
1f7a183
to
951b92a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7600 +/- ##
==========================================
+ Coverage 80.06% 81.32% +1.25%
==========================================
Files 190 240 +50
Lines 37181 44708 +7527
Branches 9450 11164 +1714
==========================================
+ Hits 29770 36359 +6589
- Misses 2997 3960 +963
+ Partials 4414 4389 -25 ☔ View full report in Codecov by Sentry. |
951b92a
to
0f5b107
Compare
431478a
to
4504ac8
Compare
4504ac8
to
ed951cf
Compare
a7bd859
to
8f0c997
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nits
019509c
to
f0e2cd1
Compare
If an index is dropped, it is necessary to lock the heap table (of the index) before the index since all normal operations do it in this order. When dropping an index, we did not take all the necessary locks in the right order before calling `performMultipleDeletions`, which can cause deadlocks when dropping an index on a hypertable at the same time as running a utility statement that takes heavy locks, e.g., VACUUM or ANALYZE. Adding a isolation test as well that will generate a deadlock if the index and table locks are not taken in the correct order.
f0e2cd1
to
e584632
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#7656 Remove limitation of compression policy for continuous aggregates **Bugfixes** * timescale#6884 Match the Postgres NaN comparison behavior in WHERE clause over compressed tables. * timescale#7600 Fix lock order when dropping index * timescale#7637 Allow EXPLAIN in read-only mode * timescale#7645 Fix DELETE on compressed chunk with non-btree operators * timescale#7649 Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * timescale#7653 Push down orderby scankeys to Hypercore TAM * timescale#7665 Block merging of frozen chunks * timescale#7673 Don't abort additional INSERTs when hitting first conflict **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * @jakehedlund for reporting the incompatible NaN behavior in WHERE clause over compressed tables. * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#7656 Remove limitation of compression policy for continuous aggregates **Bugfixes** * timescale#6884 Match the Postgres NaN comparison behavior in WHERE clause over compressed tables. * timescale#7600 Fix lock order when dropping index * timescale#7637 Allow EXPLAIN in read-only mode * timescale#7645 Fix DELETE on compressed chunk with non-btree operators * timescale#7649 Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * timescale#7653 Push down orderby scankeys to Hypercore TAM * timescale#7665 Block merging of frozen chunks * timescale#7673 Don't abort additional INSERTs when hitting first conflict **GUCs** * enable_hypercore_scankey_pushdown: Push down qualifiers as scankeys when using Hypercore TAM **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * @jakehedlund for reporting the incompatible NaN behavior in WHERE clause over compressed tables. * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#7656 Remove limitation of compression policy for continuous aggregates **Bugfixes** * timescale#7600 Fix lock order when dropping index * timescale#7637 Allow EXPLAIN in read-only mode * timescale#7645 Fix DELETE on compressed chunk with non-btree operators * timescale#7649 Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * timescale#7653 Push down orderby scankeys to Hypercore TAM * timescale#7665 Block merging of frozen chunks * timescale#7673 Don't abort additional INSERTs when hitting first conflict **GUCs** * enable_hypercore_scankey_pushdown: Push down qualifiers as scankeys when using Hypercore TAM **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * #7656 Remove limitation of compression policy for continuous aggregates **Bugfixes** * #7600 Fix lock order when dropping index * #7637 Allow EXPLAIN in read-only mode * #7645 Fix DELETE on compressed chunk with non-btree operators * #7649 Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * #7653 Push down orderby scankeys to Hypercore TAM * #7665 Block merging of frozen chunks * #7673 Don't abort additional INSERTs when hitting first conflict **GUCs** * enable_hypercore_scankey_pushdown: Push down qualifiers as scankeys when using Hypercore TAM **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * [timescale#7656](timescale#7656) Remove limitation of compression policy for continuous aggregates **Bugfixes** * [timescale#7600](timescale#7600) Fix lock order when dropping index * [timescale#7637](timescale#7637) Allow EXPLAIN in read-only mode * [timescale#7645](timescale#7645) Fix DELETE on compressed chunk with non-btree operators * [timescale#7649](timescale#7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * [timescale#7653](timescale#7653) Push down orderby scankeys to Hypercore TAM * [timescale#7665](timescale#7665) Block merging of frozen chunks * [timescale#7673](timescale#7673) Don't abort additional INSERTs when hitting first conflict **GUCs** * `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [timescale#7653](timescale#7653) **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * [timescale#7656](timescale#7656) Remove limitation of compression policy for continuous aggregates **Bugfixes** * [timescale#7600](timescale#7600) Fix lock order when dropping index * [timescale#7637](timescale#7637) Allow EXPLAIN in read-only mode * [timescale#7645](timescale#7645) Fix DELETE on compressed chunk with non-btree operators * [timescale#7649](timescale#7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * [timescale#7653](timescale#7653) Push down orderby scankeys to Hypercore TAM * [timescale#7665](timescale#7665) Block merging of frozen chunks * [timescale#7673](timescale#7673) Don't abort additional INSERTs when hitting first conflict **GUCs** * `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [timescale#7653](timescale#7653) **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * [timescale#7656](timescale#7656) Remove limitation of compression policy for continuous aggregates **Bugfixes** * [timescale#7600](timescale#7600) Fix lock order when dropping index * [timescale#7637](timescale#7637) Allow EXPLAIN in read-only mode * [timescale#7645](timescale#7645) Fix DELETE on compressed chunk with non-btree operators * [timescale#7649](timescale#7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * [timescale#7653](timescale#7653) Push down orderby scankeys to Hypercore TAM * [timescale#7665](timescale#7665) Block merging of frozen chunks * [timescale#7673](timescale#7673) Don't abort additional INSERTs when hitting first conflict **GUCs** * `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [timescale#7653](timescale#7653) **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * [timescale#7656](timescale#7656) Remove limitation of compression policy for continuous aggregates **Bugfixes** * [timescale#7600](timescale#7600) Fix lock order when dropping index * [timescale#7637](timescale#7637) Allow EXPLAIN in read-only mode * [timescale#7645](timescale#7645) Fix DELETE on compressed chunk with non-btree operators * [timescale#7649](timescale#7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * [timescale#7653](timescale#7653) Push down orderby scankeys to Hypercore TAM * [timescale#7665](timescale#7665) Block merging of frozen chunks * [timescale#7673](timescale#7673) Don't abort additional INSERTs when hitting first conflict **GUCs** * `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [timescale#7653](timescale#7653) **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
This release contains performance improvements and bug fixes since the 2.18.0 release. We recommend that you upgrade at the next available opportunity. **Features** * [#7656](#7656) Remove limitation of compression policy for continuous aggregates **Bugfixes** * [#7600](#7600) Fix lock order when dropping index * [#7637](#7637) Allow EXPLAIN in read-only mode * [#7645](#7645) Fix DELETE on compressed chunk with non-btree operators * [#7649](#7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks * [#7653](#7653) Push down orderby scankeys to Hypercore TAM * [#7665](#7665) Block merging of frozen chunks * [#7673](#7673) Don't abort additional INSERTs when hitting first conflict **GUCs** * `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [#7653](#7653) **Thanks** * @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks * @ikalafat for reporting a problem with EXPLAIN in read-only mode * Timescale community members Jacob and pantonis for reporting issues with slow queries.
If an index is dropped, it is necessary to lock the heap table (of
the index) before the index since all normal operations do it in this
order. When dropping an index, we did not take all the necessary locks
in the right order before calling
performMultipleDeletions
, which cancause deadlocks when dropping an index on a hypertable at the same time
as running a utility statement that takes heavy locks, e.g., VACUUM or
ANALYZE.
Adding a isolation test as well that will generate a deadlock if the
index and table locks are not taken in the correct order.