Bug 1422051
| Summary: | concurrent puppet reposyncs fail with PG::Error: ERROR: duplicate key value violates unique constraint "index_katello_puppet_modules_on_uuid" | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Lukas Pramuk <lpramuk> |
| Component: | Content Management | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED WONTFIX | QA Contact: | Lukas Pramuk <lpramuk> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.2.8 | CC: | bbuckingham, bkearney, hajek, jcallaha, lpramuk, mmccune, rplevka, sjagtap |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-01-04 13:08:44 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: | |||
6: Actions::Katello::Repository::IndexContent (skipped) [ 5.25s / 2.59s ]
Started at: 2017-02-10 16:01:10 UTC
Ended at: 2017-02-10 16:01:15 UTC
Real time: 5.25s
Execution time (excluding suspended state): 2.59s
Input:
---
id: 4
contents_changed: true
current_user_id: 3
Output:
--- {}
Error:
ActiveRecord::RecordNotUnique
PG::Error: ERROR: duplicate key value violates unique constraint "index_katello_puppet_modules_on_uuid" DETAIL: Key (uuid)=(5221bd7b-19e2-4b49-be3a-887a4bad0001) already exists. : INSERT INTO "katello_puppet_modules" ("author", "created_at", "name", "sortable_version", "summary", "updated_at", "uuid", "version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"
---
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:834:in
`get_last_result'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:834:in
`block in exec_cache'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract_adapter.rb:373:in
`block in log'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in
`instrument'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract_adapter.rb:367:in
`log'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in
`exec_cache'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:138:in
`exec_query'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:177:in
`exec_insert'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:95:in
`insert'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in
`insert'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation.rb:64:in
`insert'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/persistence.rb:502:in
`_create_record'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:87:in
`_create_record'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:306:in
`block in _create_record'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`block in halting_and_conditional'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`block in halting_and_conditional'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`block in halting_and_conditional'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in
`block in halting_and_conditional'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in
`run_callbacks'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:306:in
`_create_record'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/timestamp.rb:57:in
`_create_record'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/persistence.rb:482:in
`create_or_update'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in
`block in create_or_update'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in
`block in halting'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in
`block in halting'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in
`call'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in
`run_callbacks'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in
`create_or_update'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/persistence.rb:125:in
`save!'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in
`save!'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in
`save!'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in
`block in save!'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in
`block in with_transaction_returning_status'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in
`transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in
`transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in
`with_transaction_returning_status'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in
`save!'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/protected_attributes-1.1.3/lib/active_record/mass_assignment_security/persistence.rb:77:in
`block in update!'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in
`block in with_transaction_returning_status'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in
`block in transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in
`within_new_transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in
`transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in
`transaction'"
- "/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in
`with_transaction_returning_status'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/protected_attributes-1.1.3/lib/active_record/mass_assignment_security/persistence.rb:75:in
`update!'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/puppet_module.rb:78:in
`update_from_json'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/concerns/pulp_database_unit.rb:52:in
`block (2 levels) in import_all'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/concerns/pulp_database_unit.rb:47:in
`each'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/concerns/pulp_database_unit.rb:47:in
`block in import_all'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/services/katello/pulp/pulp_content_unit.rb:51:in
`block in fetch_by_uuids'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/services/katello/pulp/pulp_content_unit.rb:48:in
`each_slice'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/services/katello/pulp/pulp_content_unit.rb:48:in
`fetch_by_uuids'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/concerns/pulp_database_unit.rb:62:in
`import_all'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/concerns/pulp_database_unit.rb:72:in
`import_for_repository'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/models/katello/glue/pulp/repo.rb:721:in
`index_content'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.102/app/lib/actions/katello/repository/index_content.rb:16:in
`run'"
Is this still reproducable on 6.2.11 or later? if not, can we close this out? (In reply to Mike McCune from comment #6) > Is this still reproducable on 6.2.11 or later? if not, can we close this out? we just hit this on 6.3.0-18 I guess this indirectly answers your questions hit this on 6.4.0-16 during puppet module upload. The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Rich Jerrido or Bryan Kearney or your account team. If we do not hear from you, we will close this bug out. Thank you. Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you. |
Description of problem: During indexing the puppet content that pulp has synced a race condition can occur: 3:Katello: Actions::Pulp::Repository::Sync (success) 6:Actions::Katello::Repository::IndexContent fails when trying to insert puppet module uuid into katello_puppet_modules and failing due to unique constraint index_katello_puppet_modules_on_uuid If the uuid is present why it just doesn't update it instead of insert? Because it doesn't see it !!! in the meantime module uuids are inserted by another instance of reposync => race condition during Actions::Katello::Repository::IndexContent Version-Release number of selected component (if applicable): Sat6.2.8 How reproducible: depends on timing Steps to Reproduce: 1. run parallel puppet repository syncs of the new puppet content (that hasn't been yet synced) Actual results: Actions::Katello::Repository::IndexContent fails: PG::Error: ERROR: duplicate key value violates unique constraint "index_katello_puppet_modules_on_uuid" DETAIL: Key (uuid)=(5221bd7b-19e2-4b49-be3a-887a4bad0001) already exists. : INSERT INTO "katello_puppet_modules" ("author", "created_at", "name", "sortable_version", "summary", "updated_at", "uuid", "version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" Expected results: IndexContent handle race condition