Mailinglist Archive: zypp-devel (75 mails)

< Previous Next >
Re: [zypp-devel] libzypp download failover - server side implemented
  • From: Peter Poeml <poeml@xxxxxxx>
  • Date: Fri, 2 May 2008 18:46:07 +0200
  • Message-id: <20080502164607.GU16506@xxxxxxx>
Hi,

On Mon, Apr 21, 2008 at 07:41:46PM +0200, Dr. Peter Poeml wrote:
I have implemented a text mirror list for libzypp, which is returned
for requests containing the rfc 2295 header shown below.
I slightly changed the format.
The returned mime type is application/mirrorlist-txt.
A Vary header is set on the header for proper caching.


% curl -sH "Accept-Features: mirrorlist-txt"
'http://download.opensuse.org/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz'
| head -6
# mirrorlist-txt version=1.0
# url baseurl_len mirrorid region:country power
http://ftp.tu-chemnitz.de/pub/linux/opensuse/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz
45 39 EU:de 100
http://download.uni-hd.de/ftp/pub/linux/opensuse/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz
49 41 EU:de 100
http://opensuse.intergenia.de/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz
30 75 EU:de 100
http://widehat.opensuse.org/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz
28 97 EU:de 50

Two things:

1)

After more research, it is not needed to use Accept-Features, using
Accept request header is enough, and also straightforward.
Thus, the client needs to send "application/mirrorlist-txt" (the mime
type) in the Accept header from now on. (The above method still works
but we can remove it later on.) ((The mime-type is not well though-out,
text/mirrorlist-something might be better, or a vendor specific mime type,
let's see that later.))


2)

I have implemented injection of broken mirrors at the top of the list
for testing failover. Any client with "getPrimaryFailover-agent/0.1" in
User-Agent will get the following mirrors at the top of the list:

% curl -s -A "getPrimaryFailover-agent/0.1" -H "Accept: foobar,
application/mirrorlist-txt, */*"
'http://localhost:80/zrkadlo/distribution/10.3/repo/oss/GPLv3.txt?clientip=128.176.216.184'
| head
# mirrorlist-txt version=1.0
# url baseurl_len mirrorid region:country power
http://doesnotexist/distribution/10.3/repo/oss/GPLv3.txt 20 10001 EU:DE 100
http://www.poeml.de/nonexisting_file_for_libzypp 20 10002 EU:DE 100
http://www.poeml.de:83/nonexisting_file_for_libzypp 23 10003 EU:DE 100
http://ftp.opensuse.org:21/foobar 27 10004 EU:DE 100
http://download.opensuse.org/server-status 42 10005 EU:DE 100
http://widehat.opensuse.org:22/foobar 37 10006 EU:DE 100

I'll put it it into production onto download.opensuse.org in a few minutes.

I have updated http://en.opensuse.org/Libzypp/Failover accordingly.

...and updated again.

Nice weekend,
Peter
--
"WARNING: This bug is visible to non-employees. Please be respectful!"

SUSE LINUX Products GmbH
Research & Development
< Previous Next >
This Thread
  • No further messages