Description of problem: spacewalk-remove-channel does not clear the cache properly. The tool removes the repodata for the channel but does not remove file /var/cache/rhn/list_all_packages-${channel_name} Version-Release number of selected component (if applicable): spacewalk-backend-tools-2.0.3-18 How reproducible: Always Steps to Reproduce: 1. Have a Satellite with Channel that has the repodata generated and file /var/cache/rhn/list_all_packages-${channel_name} created. 2. Delete the channel with spacewalk-remove-channel spacewalk-remove-channel -c ${channel_name} Actual results: File /var/cache/rhn/list_all_packages-${channel_name} is not removed. Expected results: File /var/cache/rhn/list_all_packages-${channel_name} is removed as well. Additional info: Example with channel redhat-rhn-proxy-5.6-server-x86_64-6. #ll /var/cache/rhn/ total 4568 -rw-r--r--. 1 apache apache 29894 Oct 17 08:54 list_all_packages-redhat-rhn-proxy-5.6-server-x86_64-6 -rw-r--r--. 1 apache apache 3675446 Oct 29 12:55 list_all_packages-rhel-x86_64-server-6 drwxr-xr-x. 12 root root 4096 Dec 9 08:54 repodata drwxr-xr-x. 4 root root 4096 Oct 29 15:33 reposync drwxr-xr-x. 7 root root 4096 Oct 15 20:36 satsync -rw-r--r--. 1 root root 764 Dec 10 11:08 virt_state.cache # ll /var/cache/rhn/repodata/ total 40 drwxr-xr-x. 2 root root 4096 Oct 17 08:55 redhat-rhn-proxy-5.6-server-x86_64-5 drwxr-xr-x. 2 root root 4096 Oct 17 09:07 redhat-rhn-proxy-5.6-server-x86_64-6 drwxr-xr-x. 2 root root 4096 Dec 9 14:39 rhel-i386-server-6 drwxr-xr-x. 2 root root 4096 Dec 9 14:36 rhel-x86_64-server-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhel-x86_64-server-6 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhel-x86_64-server-vt-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhn-tools-rhel-x86_64-server-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhn-tools-rhel-x86_64-server-6 # spacewalk-remove-channel -l rhel-i386-server-6 rhel-x86_64-server-5 redhat-rhn-proxy-5.6-server-x86_64-5 rhel-x86_64-server-vt-5 rhn-tools-rhel-x86_64-server-5 rhel-x86_64-server-6 redhat-rhn-proxy-5.6-server-x86_64-6 rhn-tools-rhel-x86_64-server-6 # spacewalk-remove-channel -c redhat-rhn-proxy-5.6-server-x86_64-6 Deleting package metadata (76): ________________________________________ Removing: ######################################## - complete # ll /var/cache/rhn/repodata/ total 36 drwxr-xr-x. 2 root root 4096 Oct 17 08:55 redhat-rhn-proxy-5.6-server-x86_64-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:39 rhel-i386-server-6 drwxr-xr-x. 2 root root 4096 Dec 9 14:36 rhel-x86_64-server-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhel-x86_64-server-6 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhel-x86_64-server-vt-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhn-tools-rhel-x86_64-server-5 drwxr-xr-x. 2 root root 4096 Dec 9 14:42 rhn-tools-rhel-x86_64-server-6 # ll /var/cache/rhn/ total 4568 -rw-r--r--. 1 apache apache 29894 Oct 17 08:54 list_all_packages- redhat-rhn-proxy-5.6-server-x86_64-6 -rw-r--r--. 1 apache apache 3675446 Oct 29 12:55 list_all_packages-rhel-x86_64-server-6 drwxr-xr-x. 11 root root 4096 Dec 10 11:24 repodata drwxr-xr-x. 4 root root 4096 Oct 29 15:33 reposync drwxr-xr-x. 7 root root 4096 Oct 15 20:36 satsync -rw-r--r--. 1 root root 764 Dec 10 11:24 virt_state.cache
Created attachment 835812 [details] patch
Yes, this should be fixed, however list_all_packages-<label> is not the only file which can be created so this patch is incomplete. I looked at some satellites and I can see files with prefix like list_all_packages_checksum-<label>. And after I looked into code, there is more prefixes that can occur (but I don't know when): $ git grep "cache_prefix=" backend/server/rhnChannel.py: return _list_packages(channel, cache_prefix="list_packages", backend/server/rhnChannel.py: return _list_packages(channel, cache_prefix="list_all_packages", backend/server/rhnChannel.py: return _list_packages(channel, cache_prefix="list_all_packages_checksum", backend/server/rhnChannel.py: return _list_packages(channel, cache_prefix="list_all_packages_complete",
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog. This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.