Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem: There are multiple duplicate indexes present in candlepin database. Having identical indexes means the DB is spending more time updating two indexes when only one needs to be updated. Duplicate indexes should be cleaned up and there should be a workaround to cleanup indexes in the current version. We should remove the unwanted indexes during the upgrades
In Customer DB, these are the duplicate indexes are present in the DB
size | idx1 | idx2
--------+---------------------------------------+--------------------------
262 MB | cp_content_override_key_id_for_cs_idx | cp_content_override_idx1
576 kB | cp_pool_source_stack_pool_ukey | idx_sourcestack_pool_fk
32 kB | cp_dist_version_pkey | cp_dist_version_id_idx
In local environment Satellite 6.5(upgraded from 6.4) having below duplicate indexes
#su - postgres -c "psql -d candlepin -c 'SELECT indrelid::regclass AS TableName,array_agg(indexrelid::regclass) AS Indexes FROM pg_index GROUP BY indrelid,indkey HAVING COUNT(*) > 1;;'"
tablename | indexes
----------------------+----------------------------------------------------------
cp_dist_version | {cp_dist_version_id_idx,cp_dist_version_pkey}
cp_pool_source_stack | {cp_pool_source_stack_pool_ukey,idx_sourcestack_pool_fk}
(2 rows)
Version-Release number of selected component (if applicable): 6.5
How reproducible: Always
Steps to Reproduce:
1. Try to find duplicate indexes using SQL query as per summary
Actual results: There are multiple duplicates indexes
Expected results: Duplicate indexes should not be present
Index entries such as cp_content_override_key_id_for_cs_idx where hand created by the customer. Satellite is now providing providing equivalent indexes. As the customer created the original index by hand, if the customer does not wish to have duplicate indexes for the same fields, the customer should delete the indexes that they created.
Moving to new as there were 2 other pairs of indexes that are worth considering cleanup:
cp_pool_source_stack_pool_ukey & idx_sourcestack_pool_fk
cp_dist_version_pkey & cp_dist_version_id_idx
Comment 8Nikos Moumoulidis
2020-04-30 12:19:25 UTC
The Candlepin bz has been closed, and the fix has been released in candlepin-2.10.0-1 (current master). This will be included in Sat 6.8
Steps to retest:
1. ssh into satellite
2. Run command: su - postgres -c "psql -d candlepin -c 'SELECT indrelid::regclass AS TableName,array_agg(indexrelid::regclass) AS Indexes FROM pg_index GROUP BY indrelid,indkey HAVING COUNT(*) > 1;;'"
Expected result:
o duplicates in db
Actual result:
tablename | indexes
-----------+---------
(0 rows)
Verified on 6.7.0_05.
I've already checked using su - postgres -c "psql -d candlepin -c 'SELECT indrelid::regclass AS TableName,array_agg(indexrelid::regclass) AS Indexes FROM pg_index GROUP BY indrelid,indkey;;'" and saw that there's no duplicate.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2020:4366
Description of problem: There are multiple duplicate indexes present in candlepin database. Having identical indexes means the DB is spending more time updating two indexes when only one needs to be updated. Duplicate indexes should be cleaned up and there should be a workaround to cleanup indexes in the current version. We should remove the unwanted indexes during the upgrades In Customer DB, these are the duplicate indexes are present in the DB size | idx1 | idx2 --------+---------------------------------------+-------------------------- 262 MB | cp_content_override_key_id_for_cs_idx | cp_content_override_idx1 576 kB | cp_pool_source_stack_pool_ukey | idx_sourcestack_pool_fk 32 kB | cp_dist_version_pkey | cp_dist_version_id_idx In local environment Satellite 6.5(upgraded from 6.4) having below duplicate indexes #su - postgres -c "psql -d candlepin -c 'SELECT indrelid::regclass AS TableName,array_agg(indexrelid::regclass) AS Indexes FROM pg_index GROUP BY indrelid,indkey HAVING COUNT(*) > 1;;'" tablename | indexes ----------------------+---------------------------------------------------------- cp_dist_version | {cp_dist_version_id_idx,cp_dist_version_pkey} cp_pool_source_stack | {cp_pool_source_stack_pool_ukey,idx_sourcestack_pool_fk} (2 rows) Version-Release number of selected component (if applicable): 6.5 How reproducible: Always Steps to Reproduce: 1. Try to find duplicate indexes using SQL query as per summary Actual results: There are multiple duplicates indexes Expected results: Duplicate indexes should not be present