Bug 672349
| Summary: | repo package count goes negative! | ||
|---|---|---|---|
| Product: | [Retired] Pulp | Reporter: | Pradeep Kilambi <pkilambi> |
| Component: | z_other | Assignee: | John Matthews <jmatthew> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | unspecified | CC: | skarmark |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | Sprint 20 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-08-16 12:10:50 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 647488 | ||
Fixed during changes for repo["packages"] from dictionary to list. Fixed in 0.134. verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.135-1.fc14.noarch
[root@preethi ~]# pulp-admin repo delete_package --id=upload-repo -p pulp-cds -ppulp-cds
['pulp-cds-0.0.121-1.fc14.noarch', 'pulp-cds-0.0.121-1.fc14.noarch'] [{'name': 'pulp-cds', 'checksum': {'sha256': '834fb545f765603e697ab016755f59afe48c22fb7a2e1411514a165b28ea36d8'}, 'repos': ['upload-repo'], 'filename': 'pulp-cds-0.0.121-1.fc14.noarch.rpm', 'epoch': '0', 'version': '0.0.121', 'release': '1.fc14', '_id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f', 'arch': 'noarch', 'id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f'}, {'name': 'pulp-cds', 'checksum': {'sha256': '834fb545f765603e697ab016755f59afe48c22fb7a2e1411514a165b28ea36d8'}, 'repos': ['upload-repo'], 'filename': 'pulp-cds-0.0.121-1.fc14.noarch.rpm', 'epoch': '0', 'version': '0.0.121', 'release': '1.fc14', '_id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f', 'arch': 'noarch', 'id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f'}]
No dependencies to process..
Successfully removed package ['pulp-cds-0.0.121-1.fc14.noarch.rpm'] from repo [upload-repo].
[root@preethi ~]# pulp-admin repo list
+------------------------------------------+
List of Available Repositories
+------------------------------------------+
Id upload-repo
Name upload-repo
FeedURL None
FeedType None
Arch noarch
Sync Schedule None
Packages 0
Files 0
Distributions None
Publish True
Clones []
Groups None
Closing with Community Release 15 pulp-0.0.223-4. Closing with Community Release 15 pulp-0.0.223-4. |
To speed things up we store the package_count in the db. But evidently the logic is buggy * create a repo and add couple of packages * delete these packages using repo delete_package command with some duplicates * the count goes negative.. lol! Id testrepo2 Name testrepo2 FeedURL None FeedType None Arch noarch Sync Schedule None Packages -3 Files 0 Distributions None Publish True Clones [] Groups None The issue seems to be how remove_package api call is implemented: repo['packages'].pop(p['id'], None) repo['package_count'] = repo['package_count'] - 1 self.objectdb.save(repo, safe=True) so we try to pop and reduce the count by one.. but if this list has some duplicates, instead of checking if pop succeed or not, we reduce the count by 1 always.