Bug 333 - Deadlock with application during minor version upgrade.
Summary: Deadlock with application during minor version upgrade.
Status: RESOLVED FIXED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: slonik (show other bugs)
Version: devel
Hardware: All All
: low enhancement
Assignee: Rose Nancy
URL:
Depends on:
Blocks:
 
Reported: 2014-03-06 09:20 UTC by Jan Wieck
Modified: 2014-03-11 07:52 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix bug333 (2.90 KB, application/octet-stream)
2014-03-11 07:48 UTC, Rose Nancy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Wieck 2014-03-06 09:20:10 UTC
The Slony upgrade procedure for minor versions can collide with concurrently running applications, even with read only transactions.

During the upgrade the stored procedures to upgrade the schema configure all log and deny access triggers. This is done with an "ALTER TABLE ... ENABLE/DISABLE TRIGGER ..." command. This command requires an access exclusive lock on the table, which conflicts even with read only access.

This command could be skipped if the trigger in question is already configured in that enable/disable state, which can be determined by a lookup in pg_trigger. I believe that during a pure minor version upgrade, none of the triggers actually needs to be reconfigured since they all should be in the desired state already.
Comment 1 Rose Nancy 2014-03-11 07:48:45 UTC
Created attachment 200 [details]
Patch to fix bug333
Comment 2 Jan Wieck 2014-03-11 07:50:56 UTC
Applied to master, REL_2_2_STABLE and REL_2_1_STABLE.

Thank you.
Comment 3 Rose Nancy 2014-03-11 07:52:25 UTC
I have attached the patch. Please review