Issue #1979
Updated by bmbouter almost 8 years ago
This issue affects all metadata rpm types: package categories, package groups, package environments, yum_metadata_file, and package_langpacks. I'll illustrate with langpacks, but the same should be true of all of them.
There can only be 1 package_langpacks associated with a repository. You can see that when copying langpacks over and over the count continues to increment even though each copy overwrites the previous one. Consider this reproducer:
<pre>
pulp-admin rpm repo create --repo-id=repo_1
pulp-admin rpm repo create --repo-id=repo_2
pulp-admin rpm repo uploads langpacks -i hyphen -n hyphen-%s --repo-id repo_1
pulp-admin rpm repo copy langpacks --from-repo-id=repo_1 --to-repo-id=repo_2
pulp-admin rpm repo copy langpacks --from-repo-id=repo_1 --to-repo-id=repo_2
pulp-admin rpm repo copy langpacks --from-repo-id=repo_1 --to-repo-id=repo_2
</pre>
Now when listing the langpacks units for repo_2 I expect there still to be 1, but instead it shows 3:
<pre>
[vagrant@dev ~]$ pulp-admin rpm repo list --repo-id repo_2
+----------------------------------------------------------------------+
RPM Repositories
+----------------------------------------------------------------------+
Id: repo_2
Display Name: None
Description: None
Content Unit Counts:
Package Langpacks: 3
</pre>
There is still in fact only 1 package_langpack which I verified in the database with:
<pre>
> db.units_package_langpacks.find({"repo_id": "repo_2"}).count()
1
</pre>
Given ^, the machinery that handles the repo counts is not keep the count correctly. I believe that machinery is here[0].
[0]: https://github.com/pulp/pulp_rpm/blob/d52206bdff5419b5b74976089c605a6cdbeaffc4/plugins/pulp_rpm/plugins/importers/yum/associate.py#L345-L380