Some repository formats allow storing asset records without an owning component. When the Dry Run option of the Repair - Reconcile component database from blobstore task is used, logic is triggered that incorrectly deletes such asset records from the component database. The related blobs are seemingly not deleted from the blobstore ( ie. they are recoverable ) but the assets are no longer downloadable after being deleted from the database.
Recover the incorrectly deleted asset records by running a Repair - Reconcile component database from blobstore task, without the Dry Run option enabled.
1. Create a yum-hosted repo at zero depth
2. Deploy an rpm file into it. I used http://mirror.centos.org/centos/7/os/x86_64/Packages/389-ds-base-22.214.171.124-15.el7.x86_64.rpm and this command:
3. Attempt to download the RPM file at the same path you uploaded it. This should work with 200 response.
4. After 60 seconds)expected), the Browse and Search views show the repodata/* files are generated. Attempt to download these metadata files - it works.
5. Create a Repair - Reconcile component database from blobstore task. Select the Dry Run option. Run the task.
6. Bug 1: Logging reports that an RPM file would have been restored by the task:
Why would it restore that file? The file downloads fine, is a valid RPM and there are no inconsistencies between blobstore and database.
7. 60 seconds after the reconcile task finishes, the YUM metadata is rebuilt automatically - supposedly from the manipulation which did not happen? ( ie dry run ):
8. Now you are in the following state:
- the RPM blob file is still in the blob store, not marked soft-deleted or changed in any way from when it was first uploaded
- the Browse view only shows os/x86_64/Packages empty node ( normal according to docs after running reconcile )
- the Search view for yum-hosted is empty ( normal according to docs after running reconcile )
- Bug 2: attempts to download yum-hosted metadata files or the rpm file all fail with 404
9. Run the Reconcile component database from blobstore task again, this time without the Dry Run option selected. After 60 seconds yum metadata is rebuilt and repodata files and the rpm is downloadable.
The dry run option is essentially acting like it is manipulating the database in the inverse of reconciling.
- dry run should not trigger any other tasks, or act like it actually did anything other than log what it would do
- reconcile task had no business manipulating a perfectly good and working RPM, even if this was not dry run
- rpms that are not soft-deleted or manipulated visibly should still be downloadable from the yum-hosted repo, regardless of the presence of metadata