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.
Bug 1985101 - Authorization generates inefficient SQL query for taxonomy-overriden permissions
Summary: Authorization generates inefficient SQL query for taxonomy-overriden permissions
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: 6.8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-22 20:52 UTC by Pablo Hess
Modified: 2024-12-20 20:31 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-02-07 18:16:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33763 0 Normal New Authorization generates inefficient SQL query for taxonomy-overriden permissions 2021-10-26 14:29:39 UTC
Red Hat Issue Tracker SAT-5620 0 None None None 2023-09-09 08:17:01 UTC
Red Hat Knowledge Base (Solution) 7010792 0 None None None 2023-05-03 08:19:04 UTC

Description Pablo Hess 2021-07-22 20:52:30 UTC
Description of problem:
Job execution lookups prior to firing off a new job was suddenly very slow, taking upwards of 5 minutes to instantiate a single job execution.
After creating a new index on the foreman database, job execution instantiation went back to the usual duration of 3 seconds.

The index was created on the taxable_taxonomies table with the command below:

  create unique index taxable_id_id on taxable_taxonomies (taxable_id, id);


Version-Release number of selected component (if applicable):
satellite-6.8.5-1.el7sat.noarch


How reproducible:
100% of times when invoking a new job.

Steps to Reproduce:
1. Invoke new job on the web UI or through hammer.

Actual results:
Takes upwards of 5 minutes to create the job.

Expected results:
Few seconds to create the job.

Additional info:
The new index was created after examining the SQL queries being run by foreman while invoking the job. The new DB index changed the job template lookup significantly: the sql query now avoids nested loops and does merge joins and hashed joins instead.

Comment 9 Tomer Brisker 2021-10-21 14:43:38 UTC
Created redmine issue https://projects.theforeman.org/issues/33763 from this bug

Comment 10 Pablo Hess 2021-10-26 19:17:11 UTC
This issue was found again on a live Satellite 6.9.

Condition to trigger the problem: having permission filters customized to apply to an individual org or location only. The Satellite in question had many such permission filters and the slow lookup that did countless inner joins against taxable_taxonomies was being logged to take 700+ seconds.

By adding the index to the foreman db on postgres as below, the same lookup was able to complete in under 500 ms so it's not logged anymore.

    create index idx_taxable_id on taxable_taxonomies (taxable_id);


Thanks tbrisker++ for the significant assistance in identifying and characterizing this issue.

Comment 14 Brad Buckingham 2024-01-09 20:58:59 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 15 Brad Buckingham 2024-02-07 18:16:21 UTC
Thank you for your interest in Red Hat Satellite. 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 feel free to contact your Red Hat Account Team. Thank you.


Note You need to log in before you can comment on or make changes to this bug.