Bug #15407
Duplicate key on "katello_content_facet_errata_eid_caid" under load
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1344708
Reproducer:
Create several processes that register content hosts (subscription-manager register with an activation key with some content associated) in parallel.
2016-06-10 10:50:29 CEST ERROR: duplicate key value violates unique constraint +"katello_content_facet_errata_eid_caid"
2016-06-10 10:50:29 CEST DETAIL: Key (erratum_id, content_facet_id)=(18, 122) already exists.
2016-06-10 10:50:29 CEST STATEMENT: INSERT INTO katello_content_facet_errata (erratum_id, +content_facet_id) VALUES (18, 122),....
2016-06-10 10:50:29 CEST ERROR: current transaction is aborted, commands ignored until end of +transaction block
2016-06-10 10:50:29 CEST STATEMENT: DELETE FROM "katello_content_facet_errata" WHERE +"katello_content_facet_errata"."content_facet_id" = 122
2016-06-10 10:56:40 CEST ERROR: duplicate key value violates unique constraint +"katello_content_facet_errata_eid_caid"
2016-06-10 10:56:40 CEST DETAIL: Key (erratum_id, content_facet_id)=(9, 131) already exists.
2016-06-10 10:56:40 CEST STATEMENT: INSERT INTO katello_content_facet_errata (erratum_id, +content_facet_id) VALUES ...
2016-06-10 10:56:40 CEST ERROR: current transaction is aborted, commands ignored until end of +transaction block
2016-06-10 10:56:40 CEST STATEMENT: DELETE FROM "katello_content_facet_errata" WHERE +"katello_content_facet_errata"."content_facet_id" = 131
2016-06-10 11:05:13 CEST ERROR: duplicate key value violates unique constraint +"katello_content_facet_errata_eid_caid"
2016-06-10 11:05:13 CEST DETAIL: Key (erratum_id, content_facet_id)=(10, 149) already exists.
2016-06-10 11:05:13 CEST STATEMENT: INSERT INTO katello_content_facet_errata (erratum_id, +content_facet_id) VALUES ...
2016-06-10 11:05:13 CEST ERROR: current transaction is aborted, commands ignored until end of +transaction block
2016-06-10 11:05:13 CEST STATEMENT: DELETE FROM "katello_content_facet_errata" WHERE +"katello_content_facet_errata"."content_facet_id" = 149
2016-06-10 11:09:21 CEST ERROR: duplicate key value violates unique constraint +"katello_content_facet_errata_eid_caid"
2016-06-10 11:09:21 CEST DETAIL: Key (erratum_id, content_facet_id)=(1566, 147) already exists.
2016-06-10 11:09:21 CEST STATEMENT: INSERT INTO katello_content_facet_errata (erratum_id, +content_facet_id) VALUES (1566, 147), (2298, 147), (424, 147), (2828, 147), (2903, 147), (637, +147), (3931, 147), (4011, 147), (4340, 147)
2016-06-10 11:09:21 CEST ERROR: current transaction is aborted, commands ignored until end of +transaction block
2016-06-10 11:09:21 CEST STATEMENT: DELETE FROM "katello_content_facet_errata" WHERE +"katello_content_facet_errata"."content_facet_id" = 147
- rpm -q satellite katello foreman
satellite-6.2.0-14.2.el7sat.noarch
katello-3.0.0-6.el7sat.noarch
foreman-1.11.0.34-1.el7sat.noarch
Debug tarball (Foreman core team permissions needed to download it):
http://debugs.theforeman.org/foreman-debug-0Qsen.tar.xz
I am able to randomly reproduce on my own box, takes hours to hit with about 100 clients registering.
Associated revisions
History
#1
Updated by Justin Sherrill over 2 years ago
- Subject changed from Duplicate key on "katello_content_facet_errata_eid_caid" when Satellite 6.2 was put under load to Duplicate key on "katello_content_facet_errata_eid_caid" under load
#2
Updated by The Foreman Bot over 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/6123 added
#3
Updated by Justin Sherrill over 2 years ago
- Legacy Backlogs Release (now unused) set to 143
- Difficulty set to hard
#4
Updated by Justin Sherrill over 2 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|fa3f1fa37c5c347a51cbc02f97c72d9aa5f8d7f4.
Fixes #15407 - adding event queue and listener (#6123)
This adds a new queing table and model as well
as a dynflow listening task that processes queue items.
The only current event is the import errata task, to serialize
errata import so that we can resolve unique constraint
violations once and for all.