Bug 2154289

Summary: pulp can break uniq index "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq" in some way
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.4CC: dalley, lwhitty, rbram, saydas
Target Milestone: Unspecified   
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: 2023-01-05 14:59:28 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 Pavel Moravec 2022-12-16 14:15:54 UTC
Description of problem:
There are reports where Satellite upgrade from 6.11 to 6.12 are blocked by:

duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq"

error. That happens when rpm_modulemd table in pulpcore DB has entries violating uniq index rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq .

See https://access.redhat.com/solutions/6988715 for more and for manual remedy steps (error-prone, with big exclamation mark "on your own risk").

We dont have a reproducer, nor an idea how to force postgres to have violated an uniq index. An update of Satellite from 6.11.1ish to 6.11.[3-4] *might* be in charge, as far as I recall. I am glad to help finding a reproducer once I get some hint from pulp engineering. But at the end, we need (in this ordering):

1) have some safe steps to identify and recover from the "broken index".
2) fix the bug triggering the index violation

It is trivial to identify the issue - just try

REINDEX INDEX rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq;

within pulpcore DB. But remedy steps.. well, see the KCS.


Version-Release number of selected component (if applicable):
6.11


How reproducible:
unknown atm


Steps to Reproduce:
???


Actual results:
have a Satellite 6.11 with pulpcore DB violating one index, which prevents upgrade to 6.12


Expected results:
- Remedy steps from violated index state
- Prevent getting to the index violation


Additional info:
See https://bugzilla.redhat.com/show_bug.cgi?id=2044631#c52 for another instance / possibly duplicate BZ https://bugzilla.redhat.com/show_bug.cgi?id=2142270 .

Comment 1 Pavel Moravec 2022-12-16 14:28:24 UTC
As I read https://bugzilla.redhat.com/show_bug.cgi?id=2142270 more, I think it is a match / this BZ is dup.

Comment 4 Pavel Moravec 2023-01-05 14:59:28 UTC

*** This bug has been marked as a duplicate of bug 2142270 ***