https://bugzilla.novell.com/show_bug.cgi?id=381280
User dmacvicar@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=381280#c4
Duncan Mac-Vicar changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
Info Provider| |jkupec@novell.com
--- Comment #4 from Duncan Mac-Vicar 2008-05-26 07:00:34 MDT ---
Ok, after breaking libzypp with attempt one, I have a completely different
proposal/patch. I am looking the sponsorship from Jano again :-)
The original attempt broke because checkonly flag is completely undefined, it
is used somewhere, and somewhere else is not. Therefore 404 popup to the user
interface before we can do it anything about it. There is no (sane) way to do a
404 without getting a callback that is handled directly by YaST.
However, MediaCurl has the ability to look if the target file exists, and set
the correct If-Modified-Since header.
Therefore what I did was, expose the localRoot() option from MediaManager into
MediaSetAccess. localRoot(medianr) is empty if the media is not attached, so I
made MediaSetAccess::localRoot(medianr) to attach that media if it wasn't
before.
Then in RepoManager, I assumed that, the first time you download repomd.xml on
a full cache refresh, even if it is a forced one, may be the same as the one in
the old cache. So for both checkIfToRefreshMetadata I hardlinked the old cache
repomd.xml into the MediaManager::localRoot(1), if it is not the same,
Mediamanager will download it and then move it over the hardlink, replacing it
(but not the original in the old cache), the old one will not be replaced until
the compelte temp directory is moved over the old. If it succeeds, then there
is no file downloaded. The .key and .asc file can also be hardlinked and
injected into the media root.
This provides two optimizations.
* If the repomd.xml is not changed, nothing is downloaded. A kind of Fetcher
cached without knowing the checksums of the files, this includes repomd.xml and
the keys/signatures.
If repomd.xml is not changed, 0 bytes are downloaded while checking for
changes. If it is changed, then it is downloaded.
Additionally if checkIfToRefreshMetadata is refactored / splitted in 2 parts.
One that takes an additional MediaSetAccess, and the public version exposed in
the API, which in turn could instanciate the MediaSetAccess and call the other
one, could allow refreshMetadata to share the MediaSetAccess object with
checkIfToRefreshMetadata, thus also avoiding the re-transfer of repomd.xml
between checking and actually refreshing.
So if repomd.xml changed, it will be downloaded when checking if it is changed,
but when the refresh job starts, the repomd.xml will be set the right
if-modified-since and will not be transfered again.
Both changes only require us to implement the localRoot() exposure before GM,
which is only adding API. The actual changes can be delivered in an online
update as they don't change anything else than the implementation.
I have a patch which implements the first part, it works very well, and the
changes are very simple and uninstrusive.
Jano, what do you think?
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.