Bug 1395831

Summary: Feature request: use DNS to determine if manifests need downloading.
Product: [Fedora] Fedora Reporter: Penelope Fudd <bugzilla.redhat.com>
Component: dnfAssignee: rpm-software-management
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 24CC: mluscon, mmraka, packaging-team-maint, pnemade, rpm-software-management, vmukhame
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-21 12:32:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Penelope Fudd 2016-11-16 19:20:27 UTC
Description of problem:

When checking for updates after its metadata has expired, dnf has to connect to multiple servers, download manifests, validate checksums and signatures, and so on.  This takes time.  Frequently, there are no changes, and so apart from updating the timestamp of the metadata, the operation is a no-op.

Wouldn't it be nice if all that wasted work could be avoided?

The least amount of data that needs to be transferred is a 'last modified time' of the repository manifest.  The lowest-overhead protocol we can use is UDP.  The UDP protocol with the most infrastructure in place for distribution and caching is DNS.  If the last-modified time of a given repository's manifest could be written into a TXT record, then all the client would have to do is the command 'host -t TXT lastmodified.somerepository.com', and parse the result.

However, DNS is not super-secure: packets can be forged or replayed.  To mitigate the replaying problem, add a second timestamp to the TXT record called 'current time', and update the TXT record daily.  If the client gets a TXT record is more than a day old, fall back to the existing behaviour.  To mitigate the forgery problem, use gpg to sign the TXT record.  If the output of gpg is too large to fit nicely in a single UDP packet, compress it, or choose some other signing algorithm.

The result: A speedup of dnf, a reduction in network traffic to the repositories, a cached and widely distributed modification-time service with built-in jitter (to avoid the thundering-herd problem), and no more wasted cpu cycles.

Cheers!

Comment 1 Michael Mráka 2016-11-21 12:32:05 UTC
That sounds like a cool feature but I'm afraid we have no capacity to implement it. Moreover it would require a huge changes in the fedora infrastructure which are not likely to happen.

Closing as deferred.