Bug 1073691
Summary: | Table deadlock issue when processing content report due to missing index and very large transactions in ContentServerServiceImpl.mergeDiscoveredPackages | ||
---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | Larry O'Leary <loleary> |
Component: | Content, Performance | Assignee: | Jay Shaughnessy <jshaughn> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | JON 3.1.2 | CC: | jshaughn, myarboro, tsegismo |
Target Milestone: | ER04 | Keywords: | Triaged |
Target Release: | JON 3.3.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Legacy issues with ContentServerServiceImpl.mergeDiscoveredPackages caused Content reports to occasionally fail to complete due to a concurrency/deadlock issue. The fix introduces various enhancements to ensure that the process is thread safe, and fixes overall performance issues.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2014-12-11 14:00:23 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: |
Description
Larry O'Leary
2014-03-06 23:55:36 UTC
Setting to ER04 for review of relevant perf/locking. This code certainly wasn't scalable due to the umbrella Tx, and I can see how it would be susceptible to locking, due to the same umbrella Tx, and also the order in which it executed various things. This commit should make things better, maybe significantly. I have yet to actually add any indexing. I'm not sure it's required but an FK index on rhq_installed_package.resource_id would likely be the first one to add. As for the suggested FK on rhq_create_res_hist.installed_package_id, I'm not sure that issue was directly influenced by this problem. But again, FK indexes are certainly useful and I'm not against adding them when the need arises. But since indexes can themselves cause issues, it's not always a no-brainer. Committing to master to let it run through automated regression testing and get some soak time. master commit 9aa0c46edb8a74d7e02557b153b60ae1757e6a32 Author: Jay Shaughnessy <jshaughn> Date: Wed Sep 17 17:32:33 2014 -0400 This is yet another legacy code spot subject to scalability and locking issues. I've made a pass at making it more scalable and less likely to lock: - No longer process an entire report under an umbrella Tx. Break up the work into more, smaller, Txs - Reduce # of DB round trips - Remove several calls to unindexed queries - Note, no new indexes have been added at this point. We are still likely doing one full-table scan of rhq_installed_package when getting the InstalledPackages for a Resource. We may want to add an index on that FK. - Altered queries to use indexes - Removed unused queries from InstalledPackage and PackageVersion - Added some inline doco to help future genrations - Removed duplicated remote method decls from ContentManagerLocal - Fixed an issue in ContentManagerBeanTest and re-enabled a bunch of tests master commit 8e86e7b6a5ab36e34e7d47faba892444eca131f8 Author: Jay Shaughnessy <jshaughn> Date: Thu Sep 18 11:29:02 2014 -0400 add a perf-oriented unit test Setting to POST as work is currently done. Waiting for Oracle Jenkins run with the latest tests. Cherry-picked over to release/jon3.3.x commit fcae8e7e2e200ca7c0acee03396af59e64add6ee Author: Jay Shaughnessy <jshaughn> Date: Wed Sep 17 17:32:33 2014 -0400 [1073691] Table deadlock issue when processing content report due to missing index and very large transactions in ContentServerServiceImpl.mergeDiscoveredPackage This is yet another legacy code spot subject to scalability and locking issues. I've made a pass at making it more scalable and less likely to lock: - No longer process an entire report under an umbrella Tx. Break up the work into more, smaller, Txs - Reduce # of DB round trips - Remove several calls to unindexed queries - Note, no new indexes have been added at this point. We are still likely doing one full-table scan of rhq_installed_package when getting the InstalledPackages for a Resource. We may want to add an index on that FK. - Altered queries to use indexes - Removed unused queries from InstalledPackage and PackageVersion - Added some inline doco to help future genrations - Removed duplicated remote method decls from ContentManagerLocal - Fixed an issue in ContentManagerBeanTest and re-enabled a bunch of tests (cherry picked from commit 9aa0c46edb8a74d7e02557b153b60ae1757e6a32) Signed-off-by: Thomas Segismont <tsegismo> Conflicts: modules/core/domain/intentional-api-changes-since-4.12.0.xml commit 577b2fc74d554439f21560319ad08f066392de2a Author: Jay Shaughnessy <jshaughn> Date: Thu Sep 18 11:29:02 2014 -0400 [1073691] Table deadlock issue when processing content report... add a perf-oriented unit test (cherry picked from commit 8e86e7b6a5ab36e34e7d47faba892444eca131f8) Signed-off-by: Thomas Segismont <tsegismo> Moving to ON_QA as available for test with build: https://brewweb.devel.redhat.com/buildinfo?buildID=388959 Jared, that comment is fine. Thanks. |