[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#372712: as in debdelta



hi

I have the same problem with debdelta, so I want to share some
ideas

introduction: the command "debdelta-upgrade" downloads deltas , and
then applies them to create all .deb necessary for a 
'apt-get upgrade' ; so it is doing more or less the same

my advices are

1) "debdelta-upgrade"  has two threads; one thread 
downloads the patches and queues them for a second thread, that
applies them; you may do the same with pdiffs
(actually, I see some people saying that patchin is
done in parallel; in case, ignore the above)

2) anyway , it may happen that, in some unfortunate cases, the time of
downloading/patching is so high that it would be more efficient to
just download the new .deb

my solution (that I am implementing in "debdelta-upgrade" ) is
to keep a statistic of the downloading speed (serverwise)
and patching speed, and then do the math and decide

you may do the same ; each time apt-get update is invoked, look at how
many patches are needed, and do a simple computation to decide if it
is faster to download all patches or to download the new Packages.bz2

3) the current structure of pdiffs AFAIK is not optimal ;
 there is a better "binary" structure of diffs that works better, that is:

time complexity for end user:
 if N (< 128) is the number of changes that occured to Packages file
 since the last update, the user needs to download and apply
  ~ 2 (1 + log_2 (N))   diffs

disk complexity on server:
 it will use more space on servers; in this proposed version,
 the servers need to store ~ twice the diffs

here is the scheme  (in python-ish/shell-ish pseudocode):

 this is run on the server, after Packages is changed :
 let v be an increasing number, serializing the 
 successive versions of the packages files in the server
 
 def add_packages_file_to_diff_scheme(Packages):
   v = v + 1
   for x in 0 , 1 , 3 , 7 , 15 ,  31  :
    if ( x == 0 ) or  ( x & v == 0 ) :
     diff /backups/Packages.mask.$x  Packages > pdiff.$v.mask.$x
     copy Packages /backups/Packages.mask.$x

 this is run on the client:
 let w be the version number of the Packages that the user has

 def update_packages():
    while w < v :
      for x in 31 , 15 , 7 , 3 , 1 , 0 :
        if ( ( x == 0 )  or ( x & w == 0 ) ) and ( w + x + 1 <= v ) :
          download pdiff.$w.mask.$x
          patch pdiff.$w.mask.$x  Packages
          w = w + x + 1
          break

example: suppose you have version 3 , and the server has version 35 ;
in the current scheme, you would need 32 patches; in my scheme, you need
 pdiff.4.mask.0
 pdiff.8.mask.3
 pdiff.16.mask.7
 pdiff.32.mask.15
 pdiff.34.mask.1
 pdiff.35.mask.0

a.

-- 
Andrea Mennucc
 "E' un mondo difficile. Che vita intensa!" (Tonino Carotone)

Attachment: signature.asc
Description: Digital signature


Reply to: