Bug 1739867 - Broken support in libdnf of zchunk metadata after rebuilt for librepo 1.10.5
Summary: Broken support in libdnf of zchunk metadata after rebuilt for librepo 1.10.5
Keywords:
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: 30
Hardware: All
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-11 11:38 UTC by Ihor
Modified: 2019-09-17 02:14 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Ihor 2019-08-11 11:38:29 UTC
Description of problem:
After updating to libdnf-0.35.1-3.fc30.x86_64 all repositories with zchunk metadata were redownloaded with gz/xz-format metadata. 

Complain in log file /var/log/dnf.librepo.log:
2019-08-11T09:33:32Z DEBUG lr_yum_use_local: Cache directory not set, disabling zchunk

Version-Release number of selected component (if applicable):
libdnf-0.35.1-3.fc30.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Check that zchunk is enabled: dnf config-manager -- dump | grep zchunk
2. Update from libdnf-0.35.1-2.fc30.x86_64 to libdnf-0.35.1-3.fc30.x86_64.
3. Refresh metadata with command like: dnf --refresh makecache.

Actual results:
All repositories with zchunk metadata are refreshed with xz/gz metadata.

Expected results:
zchunk metadata should be preserved.

Additional info:
Replacing /usr/lib64/libdnf.so.2 from libdnf-0.35.1-2.fc30.x86_64 returned back zchunk metadata. Some config was changed in librepo for  servers that doesn't support zchunk and need to be applied to libdnf.

Comment 1 Michal Domonkos 2019-08-12 11:44:20 UTC
It appears that we don't properly enable zchunk support when building librepo on fedora:
https://github.com/rpm-software-management/librepo/blob/385e2ced1083cac0bcb19e30500311f6923e6dfc/librepo.spec#L131

This requires a closer look, however.  Marking as Triaged for now.

Comment 2 Michal Domonkos 2019-08-12 11:54:47 UTC
So it seems the conditional behaves exactly the opposite way; it defines WITH_ZCHUNK (with the OFF value being irrelevant here) which is then checked here:
https://github.com/rpm-software-management/librepo/pull/156/files

Comment 3 Jonathan Dieter 2019-08-24 15:07:09 UTC
So, what's happening is that this header in the last comment is provided by librepo, but libdnf doesn't set WITH_ZCHUNK when building, so the conditional isn't actually being set when libdnf is built.  Here's a PR to fix it in libdnf:
https://github.com/rpm-software-management/libdnf/pull/777

And here are PRs to pull in the fix into the current F30, F31 and Rawhide packages:
https://src.fedoraproject.org/rpms/libdnf/pull-request/4 - Rawhide
https://src.fedoraproject.org/rpms/libdnf/pull-request/5 - F31
https://src.fedoraproject.org/rpms/libdnf/pull-request/6 - F30

Comment 4 Jonathan Dieter 2019-08-24 15:09:24 UTC
I've tested the fix on my F30 system, and have done scratch builds in F30 and Rawhide, so I don't anticipate any problems with the fix

Comment 5 Fedora Update System 2019-09-16 06:48:41 UTC
FEDORA-2019-fb54fb2b81 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-fb54fb2b81

Comment 6 Fedora Update System 2019-09-16 06:48:41 UTC
FEDORA-2019-7d72d1e7a5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-7d72d1e7a5

Comment 7 Fedora Update System 2019-09-17 02:10:01 UTC
libdnf-0.35.2-4.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-fb54fb2b81

Comment 8 Fedora Update System 2019-09-17 02:14:02 UTC
libdnf-0.35.3-5.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-7d72d1e7a5


Note You need to log in before you can comment on or make changes to this bug.