Fix crash when attaching table to MaterializedPostgreSQL database#96871
Merged
alexey-milovidov merged 2 commits intomasterfrom Feb 15, 2026
Merged
Fix crash when attaching table to MaterializedPostgreSQL database#96871alexey-milovidov merged 2 commits intomasterfrom
alexey-milovidov merged 2 commits intomasterfrom
Conversation
The `TemporaryReplicationSlot` destructor called `dropReplicationSlot` without exception handling. If an error occurred during `addTableToReplication` (e.g., `loadFromSnapshot` failed), C++ stack unwinding would invoke this destructor. If `dropReplicationSlot` also threw (e.g., `pqxx::sql_error`: replication slot does not exist), having two exceptions in flight caused `std::terminate`, killing the server process. Wrap the destructor body in a try-catch to prevent exceptions from propagating, following the C++ rule that destructors must not throw. Closes #62711 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Workflow [PR], commit [e0adc73] Summary: ❌
|
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.
Summary
std::terminate) when attaching a table to aMaterializedPostgreSQLdatabaseTemporaryReplicationSlotdestructor calleddropReplicationSlotwithout exception handling; if an exception was already in flight (e.g. fromloadFromSnapshot) anddropReplicationSlotalso threw (pqxx::sql_error: replication slot does not exist), having two exceptions causedstd::terminateCloses #62711
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix crash when attaching a table to a
MaterializedPostgreSQLdatabase ifdropReplicationSlotthrows during stack unwinding.Documentation entry for user-facing changes
🤖 Generated with Claude Code