The execution of 'foreman-rake katello:delete_orphaned_content' has no effect on clearing orphaned content from the filesystem since Red Hat Satellite/Capsule 6.10

Solution Verified - Updated

Environment

  • Red Hat Satellite/Capsule 6.10 and above

Issue

  • After removing some repositories,content-views, etc from the Satellite server or removing some life-cycle environment from the Capsule server, the immediate execution of foreman-rake katello:delete_orphaned_content does not actually delete any orphaned data from the filesystem.

Resolution

  • The behavior of deleting Orphaned content has changed a bit in Pulp 3 and an explanation of the same can be found in the Root Cause section of this article.

  • Now, Once the necessary cleanup for the concerning Red Hat Satellite or Capsule has been done, refer to the following steps:

  • For Satellite/Capsule 6.10:

    • Take a backup of /etc/pulp/settings.py in the concerning system.

    • Edit /etc/pulp/settings.py of the concerning system and add the following option at the end i.e. ORPHAN_PROTECTION_TIME = 3.

    • Restart pulpcore specific services on the concerning Satellite or Capsule server.

      # for i in $(foreman-maintain service status -b | grep "Displaying the following" -A1 | tr "," "\n" | grep pulpcore)
         do 
         systemctl restart  $i; 
         done
      
    • Wait for exactly four minutes and then retry the command for orphan cleanup i.e. foreman-rake katello:delete_orphaned_content.

    • Once the cleanup has been completed, revert back the changes in /etc/pulp/settings.py followed by a restart of exact same set of pulpcore specific services.

  • For Satellite/Capsule 6.11 and above:

    • Navigate to the Satellite Web UI -> Administer -> Settings -> Content Tab -> Set Orphaned Content Protection Time to 3.

    • Alternatively, you can use the hammer command.

      hammer settings set --name orphan_protection_time --value 3
      
    • Restart the pulp services on the Capsule server

      # systemctl restart pulpcore-*.service
      
    • Wait for exactly four minutes and then retry the command for orphan cleanup i.e. foreman-rake katello:delete_orphaned_content.

    • Once the cleanup has been completed, revert back the Orphaned Content Protection Time to 1440.

  • For better management of this ORPHAN_PROTECTION_TIME option, the following This content is not included.Bugzilla 2043089 has been raised.

 

Root Cause

  • The Red Hat Satellite\Capsule 6.10 comes with the support of Pulp 3 and starting from Pulp 3, as soon as some content is being marked as Orphaned they are not immediately made available for the deletion.

  • There is something called Content from docs.pulpproject.org is not included.ORPHAN_PROTECTION_TIME present for Pulp 3 and Its default value is 1440 minutes (24 hours) which means, that after a content gets marked as Orphaned, Pulp will protect the content from getting deleted for 24 hours and only after that time has passed, the content can be deleted via any sort of orphan cleanup method.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.