Project

General

Profile

Bug #30797

Postgres usage spikes and disk space completely filled up, when non-admin select Monitor -> Tasks

Added by Ondřej Ezr about 2 months ago. Updated about 1 month ago.

Status:
Rejected
Priority:
High
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1741943

Description of problem:
When a role is assigned with multiple organization and non-admin user click on Monitor -> Tasks full disk space filled up quickly and satellite service goes down.

Workaround: Keep only two organization in non-admin role.

Observation: A distinct sql query runs and "/var/lib/pgsql/data/base/pgsql_tmp/" growing abnormally until all space is filled up.

Oops, we're sorry but something went wrong PG::DiskFull: ERROR: could not write to hash-join temporary file: No space left on device : SELECT DISTINCT "foreman_tasks_tasks".* FROM "foreman_tasks_tasks" INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner5931e3 ON (foreman_tasks_locks_owner5931e3.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner5931e3.resource_type = 'User' AND foreman_tasks_locks_owner5931e3.name = 'task_owner') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy55fe2b ON (foreman_tasks_locks_taxonomy55fe2b.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy55fe2b.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyf6b7fc ON (foreman_tasks_locks_taxonomyf6b7fc.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyf6b7fc.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyed1f21 ON (foreman_tasks_locks_taxonomyed1f21.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyed1f21.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyc2a23d ON (foreman_tasks_locks_taxonomyc2a23d.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyc2a23d.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomya70ca2 ON (foreman_tasks_locks_taxonomya70ca2.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomya70ca2.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy002269 ON (foreman_tasks_locks_taxonomy002269.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy002269.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy25d10d ON (foreman_tasks_locks_taxonomy25d10d.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy25d10d.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyb55bd1 ON (foreman_tasks_locks_taxonomyb55bd1.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyb55bd1.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyae8159 ON (foreman_tasks_locks_taxonomyae8159.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyae8159.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy661f6e ON (foreman_tasks_locks_taxonomy661f6e.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy661f6e.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomya51eda ON (foreman_tasks_locks_taxonomya51eda.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomya51eda.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyd00170 ON (foreman_tasks_locks_taxonomyd00170.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyd00170.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy535468 ON (foreman_tasks_locks_taxonomy535468.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy535468.resource_type = 'Organization') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomyd902c3 ON (foreman_tasks_locks_taxonomyd902c3.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomyd902c3.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy5ee8f4 ON (foreman_tasks_locks_taxonomy5ee8f4.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy5ee8f4.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy896e69 ON (foreman_tasks_locks_taxonomy896e69.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy896e69.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy9be3ca ON (foreman_tasks_locks_taxonomy9be3ca.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy9be3ca.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy287352 ON (foreman_tasks_locks_taxonomy287352.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy287352.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy187d79 ON (foreman_tasks_locks_taxonomy187d79.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy187d79.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomye59625 ON (foreman_tasks_locks_taxonomye59625.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomye59625.resource_type = 'Location') LEFT JOIN foreman_tasks_locks AS foreman_tasks_locks_taxonomy98e6c9 ON (foreman_tasks_locks_taxonomy98e6c9.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_taxonomy98e6c9.resource_type = 'Organization') WHERE (((foreman_tasks_locks_owner5931e3.resource_id = 6) OR (((foreman_tasks_locks_taxonomy55fe2b.resource_id = '7' OR foreman_tasks_locks_taxonomy55fe2b.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyf6b7fc.resource_id = '6' OR foreman_tasks_locks_taxonomyf6b7fc.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyed1f21.resource_id = '4' OR foreman_tasks_locks_taxonomyed1f21.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyc2a23d.resource_id = '9' OR foreman_tasks_locks_taxonomyc2a23d.resource_id IS NULL) OR (foreman_tasks_locks_taxonomya70ca2.resource_id = '10' OR foreman_tasks_locks_taxonomya70ca2.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy002269.resource_id = '11' OR foreman_tasks_locks_taxonomy002269.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy25d10d.resource_id = '12' OR foreman_tasks_locks_taxonomy25d10d.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyb55bd1.resource_id = '5' OR foreman_tasks_locks_taxonomyb55bd1.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyae8159.resource_id = '14' OR foreman_tasks_locks_taxonomyae8159.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy661f6e.resource_id = '13' OR foreman_tasks_locks_taxonomy661f6e.resource_id IS NULL) OR (foreman_tasks_locks_taxonomya51eda.resource_id = '20' OR foreman_tasks_locks_taxonomya51eda.resource_id IS NULL) OR (foreman_tasks_locks_taxonomyd00170.resource_id = '1' OR foreman_tasks_locks_taxonomyd00170.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy535468.resource_id = '3' OR foreman_tasks_locks_taxonomy535468.resource_id IS NULL)) AND ((foreman_tasks_locks_taxonomyd902c3.resource_id = '23' OR foreman_tasks_locks_taxonomyd902c3.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy5ee8f4.resource_id = '19' OR foreman_tasks_locks_taxonomy5ee8f4.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy896e69.resource_id = '2' OR foreman_tasks_locks_taxonomy896e69.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy9be3ca.resource_id = '21' OR foreman_tasks_locks_taxonomy9be3ca.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy287352.resource_id = '16' OR foreman_tasks_locks_taxonomy287352.resource_id IS NULL) OR (foreman_tasks_locks_taxonomy187d79.resource_id = '18' OR foreman_tasks_locks_taxonomy187d79.resource_id IS NULL) OR (foreman_tasks_locks_taxonomye59625.resource_id = '17' OR foreman_tasks_locks_taxonomye59625.resource_id IS NULL))))) AND ((foreman_tasks_locks_taxonomy98e6c9.resource_id = '5' OR foreman_tasks_locks_taxonomy98e6c9.resource_id IS NULL)) ORDER BY "foreman_tasks_tasks"."started_at" DESC NULLS LAST LIMIT $1 OFFSET $2
Back
Version-Release number of selected component (if applicable): 6.5.0

Actual results: Monitor -> Tasks gets hanged and disk space filled up

Expected results: Task page should be loaded within time


Related issues

Related to Foreman - Bug #29447: Filter builds taxonomy search filter inefficientlyClosed

History

#1 Updated by The Foreman Bot about 2 months ago

  • Assignee set to Ondřej Ezr
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-tasks/pull/584 added

#2 Updated by Ondřej Ezr about 2 months ago

Also addressed in #29447

#3 Updated by Ondřej Ezr about 2 months ago

  • Related to Bug #29447: Filter builds taxonomy search filter inefficiently added

#4 Updated by Ondřej Ezr about 2 months ago

  • Status changed from Ready For Testing to Rejected

We can't just remove it, as some plugins are using it even in this manner.
#30847 should solve the issue.

#5 Updated by Ondřej Ezr about 1 month ago

  • Bugzilla link deleted (1741943)

Also available in: Atom PDF