Block DROP EXTENSION when logical slots have pending catalog changes#10016
Draft
zilder wants to merge 3 commits into
Draft
Block DROP EXTENSION when logical slots have pending catalog changes#10016zilder wants to merge 3 commits into
zilder wants to merge 3 commits into
Conversation
Since `_timescaledb_catalog.hypertable` and `chunk` were marked as user_catalog_tables, dropping the extension while a logical replication slot still has unconsumed WAL referencing these tables leaves the slot permanently broken: subsequent `pg_logical_slot_get_changes()` calls fail with "could not find pg_class entry for ...". Add a guard in `process_drop_start` that refuses `DROP EXTENSION timescaledb` when any in-use logical slot's `confirmed_flush_lsn` is behind the latest modification to those tables.
svenklemm
requested changes
Jun 20, 2026
svenklemm
left a comment
Member
There was a problem hiding this comment.
This should not be done in timescaledb extension we want extension updates to be quick and predictable so any required slot management needs to happen outside of the extension since they are not managed by timescaledb.
Member
Author
|
At very least we should provide a tool to verify the state of a slot against the catalog, would you agree? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
_timescaledb_catalog.hypertableandchunkwere marked asuser_catalog_tables, dropping the extension while a logical replication slot still has unconsumed WAL referencing these tables leaves the slot permanently broken: subsequentpg_logical_slot_get_changes()calls fail with "could not find pg_class entry for ...".Add a guard in
process_drop_startthat refusesDROP EXTENSION timescaledbwhen any in-use logical slot'sconfirmed_flush_lsnis behind the latest modification to those tables.