Bug 1053591
| Summary: | Cloning channel with "spacewalk-clone-by-date" ends with deadlock error | ||
|---|---|---|---|
| Product: | [Community] Spacewalk | Reporter: | Milan Zázrivec <mzazrivec> |
| Component: | Server | Assignee: | Milan Zázrivec <mzazrivec> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Red Hat Satellite QA List <satqe-list> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 2.1 | CC: | ggainey, ggruner, ldelouw, mzazrivec, pmutha, tbily, xdmoon |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | spacewalk-java-2.1.124-1 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1023334 | Environment: | |
| Last Closed: | 2014-03-04 13:06:39 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1069560 | ||
|
Description
Milan Zázrivec
2014-01-15 13:19:43 UTC
spacewalk.git master: d0815058c8892c8f5a0642cc592ff97fcaa49374 Switching MODIFIED Spacewalk bugs to ON_QA before 2.1 release. Previous commits reverted in spacewalk.git master: ab519082232175cba498721360298ddd80e458ab aabceb78217f6402558bde106d886511ebacb027 Locking rhnChannel table at the beginning of rhn_channel.refresh_newest_package won't suffice, since the resources, over which the two deadlocking transactions compete were locked before entry to the procedure. Fixed in spacewalk.git master: bded6355c0ef72f980cbedac7ede350bf6b81fc6 Race condition described in the initial comment was not valid. Race condition leading to the deadlock: * Transaction 1: insert into rhnChannelPackage (channel_id, package_id) values (1, 1) * Transaction 2: insert into rhnChannelPackage (channel_id, package_id) values (1, 2) * Transaction 1: rhn_channel.update_channel(1) Part of this procedure is: update rhnChannel set ... where id = 1 PostgreSQL grants transaction 1 exclusive lock on rhnChannel table, but at this point, transaction 1 has to wait till transaction 2 finishes, since both transaction 1 and 2 hold a RowShareLock on rhnChannel row where rhnChannel.id = 1 * Transaction 2: rhn_channel.refresh_newest_package(1) Part of this procedure is: update rhnChannel set ... where id = 1 Transaction 2 at this point won't even be able to acquire ExclusiveLock on rhnChannel table, so it has to wait, till transaction 1 finishes. Transaction 1 waits for transaction 2 to finish & transaction 2 waits for transaction 1 to finish -> deadlock. Spacewalk 2.1 has been released. https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21 Spacewalk 2.1 has been released. https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21 |