Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-25155

Pulp never purge the completed tasks

XMLWordPrintable

    • Sprint 134, Sprint 135, Sprint 136, Sprint 137, Sprint 138, Sprint 139, Sprint 140, Sprint 141
    • Moderate
    • Automated
    • No

      Description of problem:
      The completed Pulp tasks stay forever and never be purged by Pulp. For a busy Satellite environment, the number of completed tasks can easily reach millions of records.

      Large tasks table may cause the following issues:

      1. Large core_task table size (more than 10GB)
      2. Affecting Pulp performance related to pulp task queries.

      For example. we can see the following slow queries of core_task table in the database logs.
      ~~~
      duration: 5173.306 ms statement: SELECT 1 AS "a" FROM "core_task" WHERE ("core_task"."pulp_created" < 'xxxxxxxxxxxxx'::timestamptz AND "core_task"."state" IN ('waiting', 'running', 'canceling') AND "core_task"."reserved_resources_record" && (ARRAY['/pulp/api/v3/domains/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/', '/api/v3/distributions/', 'shared:/api/v3/distributions/'])::text[]) LIMIT 1

      duration: 6680.679 ms statement: SELECT 1 AS "a" FROM "core_task" WHERE ("core_task"."pulp_created" < 'xxxxxxxxxxxxx'::timestamptz AND "core_task"."state" IN ('waiting', 'running', 'canceling') AND "core_task"."reserved_resources_record" && (ARRAY['/pulp/api/v3/domains/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/', '/api/v3/distributions/', 'shared:/api/v3/distributions/'])::text[]) LIMIT 1
      ~~~

      Additional info:
      The workaround to use pulp command to purge the tasks.

      E.g. the below command will purge the completed tasks older than 2 weeks.
      ~~~
      pulp -force task purge --finished-before $(date --date="$(date) -2 week" +%Y%m-%d) --state completed --state failed --state canceled
      ~~~

              iballou@redhat.com Ian Ballou
              rhn-support-hyu Hao Chang Yu
              Vladimír Sedmík Vladimír Sedmík
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: