debugging aid
[rersyncrecent.git] / Todo
blobcfc7288cd59dbf101cec5a888fb3d2ad66758a63
1 2009-03-20  Andreas J. Koenig  <andk@cpan.org>
3         * bug on the mirroring slave: when the dirtymark gets increased we
4         probably do not reset the done intervals. The mirrorer stays within
5         tight bounds where it tries to sync with upstream and never seems to
6         finish. In the debugging state file I see lots of identical intervals
7         that do not get collapsed. When I restart the mirrorer it dies with:
9 Sync 1237507989 (227/33111/Z) id/X/XI/XINMING/Catalyst-Plugin-Compress.tar.gz ...
10 _bigfloatcmp called with l[1237400817.94363]r[UNDEF]: but both must be defined at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile/FakeBigFloat.pm line 76
11         File::Rsync::Mirror::Recentfile::FakeBigFloat::_bigfloatcmp(1237400817.94363, undef) called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile/FakeBigFloat.pm line 101
12         File::Rsync::Mirror::Recentfile::FakeBigFloat::_bigfloatge(1237400817.94363, undef) called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile/Done.pm line 226
13         File::Rsync::Mirror::Recentfile::Done::_register_one('File::Rsync::Mirror::Recentfile::Done=HASH(0x84c6af8)', 'HASH(0xb693f2dc)') called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile/Done.pm line 200
14         File::Rsync::Mirror::Recentfile::Done::register('File::Rsync::Mirror::Recentfile::Done=HASH(0x84c6af8)', 'ARRAY(0x8c54bfc)', 'ARRAY(0xb67e618c)') called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile.pm line 1044
15         File::Rsync::Mirror::Recentfile::_mirror_item('File::Rsync::Mirror::Recentfile=HASH(0x84abcb0)', 227, 'ARRAY(0x8c54bfc)', 33110, 'File::Rsync::Mirror::Recentfile::Done=HASH(0x84c6af8)', 'HASH(0x84abd8c)', 'ARRAY(0x839cb64)', 'HASH(0x839c95c)', 'HASH(0xb6a30f0c)', ...) called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recentfile.pm line 992
16         File::Rsync::Mirror::Recentfile::mirror('File::Rsync::Mirror::Recentfile=HASH(0x84abcb0)', 'piecemeal', 1, 'skip-deletes', 1) called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recent.pm line 564
17         File::Rsync::Mirror::Recent::_rmirror_mirror('File::Rsync::Mirror::Recent=HASH(0x84ab6d4)', 7, 'HASH(0x8499488)') called at /home/k/sources/rersyncrecent/lib/File/Rsync/Mirror/Recent.pm line 532
18         File::Rsync::Mirror::Recent::rmirror('File::Rsync::Mirror::Recent=HASH(0x84ab6d4)', 'skip-deletes', 1) called at /home/k/sources/CPAN/GIT/trunk/bin/testing-rmirror.pl line 27
20         and debugging stands at
22 At: before
23 Brfinterval: Z
24 Ci: 227
25 Dre+1: 
26   epoch: 1237400802.5789
27   path: id/J/JO/JOHND/CHECKSUMS
28   type: new
29 Dre-0: 
30   epoch: 1237400807.97514
31   path: id/M/MI/MIYAGAWA/CHECKSUMS
32   type: new
33 Dre-1: 
34   epoch: 1237400817.94363
35   path: id/X/XI/XINMING/Catalyst-Plugin-Compress.tar.gz
36   type: new
37 Eintervals: 
38   - 
39     - 900644040
40     - 900644040
41   - []
43         and it is reproducable.
45         Why does the mirrorer not fetch a newer Z file? It is 18 hours old while
46         pause has a fresh one.
47         
48 2009-03-17  Andreas J. Koenig  <andk@cpan.org>
50         * done: verified the existence of the floating point bug in bleadperl
51         and verified that switching from YAML::Syck to YAML::XS does not resolve
52         it.
54         BTW, the switch was doable with
56         perl -i~ -pe 's/Syck/XS/g' lib/**/*.pm t/*.t
58         and should be considered as a separate TODO
60         * todo: integrate a dirty update with two aggregate calls before
61         unlocking for frictionless dirtying
63         * todo: start the second rsync daemon on pause
65         * todo: move index files to .recent: this cannot simply be done by
66         setting filenameroot to .recent/RECENT. Other parts of the modules rely
67         on the fact that dirname(recentfile) is the root of the mirrored tree.
69 2009-03-16  Andreas J. Koenig  <andk@cpan.org>
71         * What was the resolution of the mirror.pl delete hook bug? Do we call
72         the delete hook when pause removes a file from MUIR?
74         * Today on pause: Updating 2a13fba..29f284d and installing it for
75         /usr/local/perl-5.10.0{,-RC2}
77         TURUGINA/Set-Intersection-0.01.tar.gz was the last upload before this
78         action and G/GW/GWILLIAMS/RDF-Query-2.100_01.tar.gz the first after it
80 2009-03-15  Andreas J. Koenig  <andk@cpan.org>
82         * currently recent_events has the side effect of setting dirtymark
83         because it forces a read on the file. That should be transparent, so
84         that the dirtymark call always forces a cache-able(?) read.
86         * The bug below is -- after a lot of trying -- not reproducible on a
87         small script, only in the large test script. The closest to the output
88         below was:
90 #!perl
91 use strict;
92 use Devel::Peek;
93 my $x = "01237123229.8814";
94 my($l,$r);
95 for ($l,$r) {
96     $_ = "x"x34;
98 ($l,$r) = ($1,$2) if $x =~ /(.)(.+)/;
99 $r = int $r;
100 $l = "1237123231.22458";
101 $r = "1237123231.22458";
102 1 if $l/1.1;
103 Devel::Peek::Dump $l;
104 Devel::Peek::Dump $r;
105 Devel::Peek::Dump $x = $l <=> $r;
106 die "BROKE" if $x;
107 __END__
109         The checked in state at c404a85 fails the test with my
110         /usr/local/perl-5.10-uld/bin/perl on 64bit but curiously not with
111         /usr/local/perl-5.10-g/bin/perl. So it seems the behaviour is not even
112         in the test script always consistent.
114         * Todo: write a test that inserts a second dirty file with an already
115         existing timestamp. DONE
117         * Bug in perl 5.10 on my 64bit box:
119   DB<98> Devel::Peek::Dump $l
120 SV = PVMG(0x19e0450) at 0x142a550
121   REFCNT = 2
122   FLAGS = (PADMY,NOK,POK,pNOK,pPOK)
123   IV = 0
124   NV = 1237123231.22458
125   PV = 0x194ce70 "1237123231.22458"\0
126   CUR = 16
127   LEN = 40
129   DB<99> Devel::Peek::Dump $r
130 SV = PVMG(0x19e0240) at 0x142a3e8
131   REFCNT = 2
132   FLAGS = (PADMY,POK,pPOK)
133   IV = 1237123229
134   NV = 1237123229.8814
135   PV = 0x19ff900 "1237123231.22458"\0
136   CUR = 16
137   LEN = 40
139   DB<100> Devel::Peek::Dump $l <=> $r
140 SV = IV(0x19ea6e8) at 0x19ea6f0
141   REFCNT = 1
142   FLAGS = (PADTMP,IOK,pIOK)
143   IV = -1
145   DB<101> Devel::Peek::Dump $l
146 SV = PVMG(0x19e0450) at 0x142a550
147   REFCNT = 2
148   FLAGS = (PADMY,NOK,POK,pNOK,pPOK)
149   IV = 0
150   NV = 1237123231.22458
151   PV = 0x194ce70 "1237123231.22458"\0
152   CUR = 16
153   LEN = 40
155   DB<102> Devel::Peek::Dump $r
156 SV = PVMG(0x19e0240) at 0x142a3e8
157   REFCNT = 2
158   FLAGS = (PADMY,NOK,POK,pIOK,pNOK,pPOK)
159   IV = 1237123231
160   NV = 1237123231.22458
161   PV = 0x19ff900 "1237123231.22458"\0
162   CUR = 16
163   LEN = 40
165         Retry with uselongdouble gives same effect. Not reproducable on 32bit box (k75).
167         * Todo: reset "done" or "covered" and "minmax" after a dirty operation?
169 2009-03-11  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
171         * $obj->merge ($other) needs to learn about equal epoch which may happen
172         since dirty_epoch intruded.
174         * Wontfix anytime soon: I think we currently do not support mkdir. Only
175         files!
177 2009-01-01  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
179         * Todo: continue working on update(...,$dirty_epoch). It must be
180         followed by a fast_aggregate!
182 2008-12-26  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
184         * maybe we need a closest_entry or fitting_interval or something like
185         that. We want to merge an event into the middle of some recentfile.
186         First we do not know which file, then we do not know where to lock,
187         where to enter the new item, when and where to correct the dirtymark.
189         So my thought is we should first find which file.
191         Another part of my brain answers: what would happen if we would enter
192         the new file into the smallest file just like an ordinary new event,
193         just as an old event?
195         (1) we would write a duplicate timestamp? No, this would be easy to
196         avoid
198         (2) we would make the file large quickly? Yes, but so what? We are
199         changing the dirtymark, so are willing to disturb the downstream hosts.
201 2008-11-22  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
203         * 10705 root      17   0  725m 710m 1712 S  0.0 46.8 834:56.05 /home/src/perl/repoperls/installed-perls/perl/pVNtS9N/perl-5.8.0@32642/bin/perl -Ilib /home/k/sources/CPAN/GIT/trunk/bin/testing-rmirror.pl
205         leak!
207         https://rt.cpan.org/Ticket/Display.html?id=41199
209         * bzcat uploads.csv.bz2 | perl -F, -nale '$Seen{$F[-1]}++ and print'
211         Strangest output being HAKANARDO who managed to upload 
213         Here is a better oneliner that includes also the first line of each
214         finding:
216         bzcat uploads.csv.bz2 | perl -MYAML::Syck -F, -nale '$F[-1]=~s/\s+\z//; push @{$Seen{$F[-1]}||=[]},$_; END {for my $k (keys %Seen){ delete $Seen{$k} if @{$Seen{$k}}==1; } print YAML::Syck::Dump(\%Seen)}'
218 2008-10-31  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
220         * memory leak in the syncher? It currently weighs 100M.
222         Update 2008-11-02:
224         root     10705  1.0  4.9  80192 76596 pts/32   S+   Nov02  24:05 /home/src/perl/repoperls/installed-perls/perl/pVNtS9N/perl-5.8.0@32642/bin/perl -Ilib /home/k/sources/CPAN/GIT/trunk/bin/testing-rmirror.pl
227 2008-10-29  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
229         * lookup by epoch and by path and use this ability on the pause to never
230         again register a file twice that doesn't need it. Let's call it
231         contains().
232         
233         * after the dirtymark is done: fill up recentfiles with fake (historic)
234         entries; fill up with individual corrections; algorithm maybe to be done
235         with bigfloat so that we can always place something in the middle
236         between two entries. Before we must switch to bigfloat we could try to
237         use Data::Float::nextup to get the.
239         * Inotify2 on an arbitrary tree and then play with that instead of PAUSE
240         directly.
242         * dirtymark now lives in Recentfile, needs to be used in rmirror.
244         * find out why the downloader died after a couple of hours without a net
245         connection. Write a test that survives the not-existence of the other
246         end forever.
248 2008-10-15  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
250         * reconsider the HTTP epoch only. Not the whole thing over HTTP because
251         it makes less sense with tight coupling for secondary files. But asking
252         the server what the current epoch is might be cheaper on HTTP than on
253         rsync. (Needs to be evaluated)
255         * remove the 0.00 from the verbose overview in the Merged column in the
256         Z row. DONE
258         * write tests that expose the problems of the last few days: cascading
259         client/server roles, tight coupling for secondary RFs, deletes after
260         copies.
262         * Some day we might want to have policy options for the slave:
263         tight/loose/no coupling with upstream for secondary RFs. tight is what
264         we have now. loose would wait until a gap occurs that can be closed.
266 2008-10-14  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
268         * revisit all $rfs->[$i+1] places if they now make sense still
270 2008-10-11  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
272         * another bug is the fact that the mirror command deletes files before
273         it unhides the index file, thus confusing downstream slaves. We must not
274         delete before unhiding and must delete after unhiding. FIXED.
276         * new complication about the slave that is playing a server role.
277         Currently we mirror from newest to oldest with a hidden temporary file
278         as index. And when one file is finished, we unhide the index file.
279         Imagine the cascading server/slave is dead for a day. It then starts
280         mirroring again with the freshest thing and unhides the freshest index
281         file when it has worked through it. In that moment it exposes a time
282         hole. Because it now works on the second recentfile which is still
283         hidden.
285         We currently do nothing special to converge after such a drop out. At
286         least not intentionally and robustly and thought through.
288         The algorithm we use to seed the next file needs quite a lot of more
289         robustness than it currently has. Something to do with looking at the
290         merged element of the next rf and when it has dropped off, we seed
291         immediately. And if it ramains dropped off, we seed again, of course.
293         Nope, looking from smaller to larger RFS we look at the merged element
294         of this RF and at the minmax/max element of the next RF. If that
295         $rf[next]->{minmax}{max} >= $rf[this]->{merged}{epoch}, then we can stop
296         seeding it.
298         And we need a public accessor seed and unseed or seeded. But not the mix
299         of public and private stuff that then is used behind the back.
301         And then the secondary* stuff must go.
303         And we must understand what the impact is on the DONE system. Can it go
304         unnoticed that there was a hole? And could the DONE system have decided
305         the hole is covered? This should be testable with three directories where
306         the middle stops working for a while. Done->merge is suspicious, we must
307         stop it from merging non-conflatable neighbors due to broken continuity.
309         FIXED
311 2008-10-10  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
313         * Slaven suggests to have the current epoch or the whole current
314         recentfile available from the HTTP server and take it away with
315         keepalive. This direction goes the granularity down to subseconds.
317         We might want to rewrite everything to factor out transport and allow
318         the whole thing to run via HTTP.
320 2008-10-09  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
322         * are we sure we do NOT LEAVE DOT FILES around? Especially on the
323         symlink?
325         * smoker on k81 fetching from k75 to verify cascading works. See
326         2008-07-17 in upgradexxx and rsync-over-recentfile-3.pl.
328         * maybe the loop should wait for CHECKSUMS file after every upload. And
329         CPAN.pm needs to deal with timestamps in the future.
331         * do not forget the dirtymark!
333         Text: have a new flag on recentfiles with the meaning: if this
334         changes, you're required to run a full rsync over all the files. The
335         reason why we set it would probably be: some foul happened. we injected
336         files in arbitrary places or didn't inject them although they changed.
337         The content of the flag? Timestamp? The relation between the
338         recentfiles would have to be inheritance from the principal, because any
339         out of band changes would soon later propagate to the next recentfile.
341         By upping the flag often one can easily ruin the slaves.
343         last out of band change? dirtymark?
345         Anyway, this implies that we read a potentially existing recentfile
346         before we write one.
348         And it implies that we have an eventloop that keeps us busy in 2-3
349         cycles, one for current stuff (tight loop) and one for the recentfiles
350         (cascade when principal has changed), one for the old stuff after a
351         dirtymark change.
353         And it implies that the out-of-band change in any of the recentfiles
354         must have a lock on the principal file and there is the place to set the
355         dirtymark.
357         * start a FAQ, especially quick start guide questions. Also to aid those
358         problematic areas where we have no good solution, like the "links"
359         option to rsync.
361         * wish feedback when we are slow.
363         * reduce mccabe
365         * Remove a few DEBUG statements.
367         * The multiple-rrr way of doing things needs a new option to rmirror,
368         like piecemeal or so. Not urgent because after the first pass through,
369         things run smoothely. It's only ugly during the first pass.
371         * I have the suspicion that the code is broken that decides if the
372         neighboring RF needs to be seeded. I fear when too much time has gone
373         between two calls (in our case more than one hour), it would not seed
374         the neighbor. Of course this will never be noticed, so we need a good
375         test for it.
377         * local/localroot confusion: I currently pass both options but one must
378         do.
380         * accounts for early birds on PAUSE rsync daemon.
382         * hardcoded 20 seconds
384         * who mirrors the index? DOING now.
386         * which CPAN mirrors offer rsync?
388         * visit all XXX, visit all _float places
390         * rename the pathdb stuff, it's too confusing. No idea how.
392         * rrr-inotify, backpan, rrr-register
394 2008-10-08  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
396         * current bugs: the pathdb seems to get no reset, the seeding of the
397         secondaryttl stuff seems not to have an effect. Have helped myself with
398         a rand(10), need to fix this back. So not checked in. Does the rand
399         thing even help?
401         The rand thing helps. The secondaryttl stuff was in the wrong line,
402         fixed now.
404         The pathdb stuff was because I called either _pathdb or __pathdb on the
405         wrong object. FIXED now.
407         * It's not so beautiful if we never fetch the recentfiles that are not
408         the principal, even if this is correct behaviour. We really do not need
409         them after we have fetched the whole content.
411         OK, we want a switch for that: secondaryttl DONE
413 2008-10-07  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
415         * bug: rrr-news --max does not count correctly. with "35" it shows me 35
416         lines but with 36 it shows 110. First it repeats 35, gives 70, and then
417         it lets 40 follow. FIXED
419         * See that the long running process really only updates the principal
420         file unless it has missed a timespan during which something happened. If
421         nothing happened, it must notice even when it misses the timespan. DONE
423         * we must throw away the pathdb when we have reached the end of Z. From
424         that moment we can have a very small pathdb because the only reason for
425         a pathdb is that we know to ignore old records in old files. We won't
426         need this pathdb again before the next full pass over the data is
427         necessary and then we will rebuild it as we go along. DONE
429 2008-10-06  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
431         * I think, Done::register_one is doing wrong in that it does not
432         conflate neighboring pieces. The covered() method cannot do this because
433         it has no recent_events array at hand. But register_one has it and could
434         do it and for some reason misses to do it (sometimes).
436         This means that the three tests I just wrote can probably not survive
437         because they test with an already broken Done structure.
439         The art now is to detect how it happens, then to reproduce, then write a
440         test, then fix it.
442         So from the logfile this is what happens: we have a good interval with
443         newest file being F1 at T1. Now remotely F1 gets a change and F2 goes on
444         top of it. Locally we now mirror F2 and open a new done interval for it.
445         Then we mirror F1 but this time with the timestamp T1b. And when we then
446         try to close the gap, we do not find T1 but instead something older. We
447         should gladly accept this older piece and this would fix this bug.
449         FIXED
451         * bug to fix: when the 1h file changes while rmirror is running, we do
452         correctly sync the new files but never switch to the 6h file but rather
453         stay in a rather quick loop that fetches the 1h file again and again.
455         Is it possible that we initialize a new object? Or does
456         get_remote_recentfile_as_tempfile overwrite something in myself?
458         Want a new option: _runstatusfile => $file which frequently dumps the
459         state of all recentfiles to a file.
461         FIXED
463 2008-10-04  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
465         * Todo: now teach update to verify the timestamp is about to write
466         against the previous and use _increase_a_bit if it doesn't comply with
467         strict monotony. DONE
469         * The problem of rounding. So far perl's default precision was
470         sufficient. One day it won't be. FakeFloat has an easy job when it is
471         only reading and other machines have written correctly. But when we want
472         to write a floating point number that is a bit larger than the other
473         one, then we need our own idea of precision.
475         Slaven said: just append a "1". This might be going towards the end of
476         usability too quickly. I'd like something that actually uses the decimal
477         system. Well, appending a 1 also does this but...
479         E.g. we have 1.0. nextup on this architecture is starting with
480         1.0000000000000004. So there is a gap to fill: 1,2,3. Now I have
481         taken the 1.0000000000000003 and the next user comes and the time tells
482         him 1.0 again. He has to beat my number without stepping over the
483         nextup. This is much less space than I had when I chose 1,2,3.
485         What is also irritating is that nextup is architecture dependent. The
486         128 bit guy must choose very long numbers to fit in between whereas the
487         other one with 16 bit uses larger steps. But then the algorithm is the
488         same for both, so that would be a nice thing.
490         I see two situation where we need this. One is when Time::HiRes returns
491         us a value that is <= the last entry in our recentfile. In this case
492         (let's call it the end-case) we must fill the region between that number
493         and the next higher native floating point number. The other is when we
494         inject an old file into an old recentfile (we would then also set a new
495         dirtymark). We find the integer value already taken and need a slightly
496         different one (let's call it the middle-case). The difference between
497         the two situations is that the next user will want to find something
498         higher than my number in the end-case and something lower than my number
499         in the middle case.
501         So I suggest we give the function both a value and an upper bound and it
502         calculates us a primitive middle. The upper bound in the middle-case is
503         the next integer. The upper bound on the end-case is the nextup floating
504         point number. But the latter poses another problem: if we have occupied
505         the middle m between x and nextup(x), then the nextup(m) will probably
506         not be the same as nextup(x) because some rounding will take place
507         before the nextup is calculated and when the rounding reaches the
508         nextup(x), we will end up at nextup(nextup(x)).
510         So we really need to consider the nextup and the nextdown from there and
511         then the middle and that's the number we may approach asymptotically.
512         Ugly. But DONE.
514 2008-10-03  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
516         * consider deprecating the use of RECENT.recent as a symlink. It turns
517         out to need extra hoops with the rsync options and just isn't worth it.
518         Or maybe these extra hoops are needed anyway for the rest of the tree?
519         Nope, can't be the case because not all filesystems support symlinks.
521         But before doing the large step, I'll deprecate the call of
522         get_remote_recentfile_as_tempfile with an argument. Rememberr this was
523         only introduced to resolve RECENT.recent and complicates the routine far
524         beyond what it deserves.
526         DONE. Won't deprecate RECENT.recent, just moved its handling to the
527         supervisor.
529 2008-10-02  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
531         * I think it's a bug that the rsync_option links must be set to true in
532         order to support RECENT.recent and that nobody cares to set it
533         automatically. Similar for ignore_link_stat_errors.
535 2008-09-27  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
537         * Todo: find all todos together and make a plan what is missing for a
538         release.
540         - verifytree or something like that. fsck maybe.
542         - rersyncrecent, the script itself? What it do?
544         - a way to only mirror the recentfiles without mirroring the whole
545         remote system such that people can decide to mirror only partially see
546         also 2008-08-30. .shadow-xxx directory? this also needed for a
547         filesystem that is still incomplete and might need the mirrorfiles for
548         lookup(?)
549         
550         - long living objects that mirror again and again. Inject something
551         into ta, see how it goes over to tb.
553         - how do we continue filling up the DONE system when we use an object
554         for the second time? "fully covered" and "uptodate" or new terminology.
556         - overview called on the wrong file should be understandable
558         - the meta data field that must change when we fake something up so that
559         the downstream people know they have to re-fetch everything.
561         - how tolerant are we against missing files upstream? how do we keep
562         track? there are legitimate cases where we did read upstream index right
563         before a file got deleted there and then find that file as new and want
564         it. There are other cases that are not self healing and must be tracked
565         and bugreported.
567         - how, exactly, do we have to deal with deletes? With rsync errors? 
569         rsync: link_stat "/id/K/KA/KARMAN/Rose-HTMLx-Form-Related-0.07.meta" (in
570         authors) failed: No such file or directory (2)
572         The file above is a delete in 1h and a new in file 1M and the
573         delete in the locally running rmirror did not get propagated to the 1M
574         object. Bug. And the consequence is a standstill.
576         It seems that a slave that works with a file below the principal needs
577         to merge things all the way up to get rid of later deletes. Or keep
578         track of all deletes and skip them later. So we need a trackdeletes.pm
579         similar to the done.pm?
581         see also 2008-08-20 about spurious deletes that really have no add
582         counterpart and yet they are not wrong.
584         - consider the effect when resyncing the recentfile takes longer than
585         the time per loop. Then we never rsync any file. We need to diagnose
586         that and force an increase of that loop time. But when we later are fast
587         enough again because the net has recovered, then we need to switch back
588         to original parameters. ERm, no, it's enough to keep syncing at least
589         one file before refetching an index file.
591         - remember to verify that no temp files are left lying around and the
592         signal handler
594         - status file for not long running jobs that want to track upstream with
595         a, say, cronjob.
597         - revisit all XXX _float areas and study Sub::Exporter DONE
599         - persistent DB even though we just said we do not need it. Just for
600         extended capabilities and time savings when, for example, upstream
601         announces a reset and we get new recentfiles and could then limit
602         ourselves to a subset of files (those that have a changed epoch) in a
603         first pass and would only then do the loop to verify the rest. Or
604         something.
606         * Todo: aggregate files should know their feed and finding the principal
607         should be done stepwise. (?)
609         * Todo: DESTROY thing that unlocks. Today when I left the debuggerr I
610         left locks around. DONE
612 2008-09-26  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
614         * maybe extend the _overview so that it always says if and where the
615         last file is in the next file and where the next event in the next rf
616         would lie. No, don't like this anymore. REJECT
618         * take the two new redundant tests out again, only the third must
619         survive. DONE
621         * Todo: add a sanity check if the merged structure is really pointing to
622         a different rf and that this different rf is larger. DONE
624 2008-09-25  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
626         * now test, if they are overlapping. And test if there is a file in the
627         next rf that would fit into this rf's interval.
629         1h  1222324012.8474  1222322541.7963           0.4086
630         6h  1222320411.2760  1222304207.6931           4.5010 missing overlap/gap!
631         1d  1222320411.2760  1222238750.5071          22.6835 large overlap
632         1W  1222313218.3626  1221708477.5829         167.9835
634         I suspect that somebody writes a merged timestamp without having merged
635         and then somebody else relies on it.
637         If aggregate is running, the intervals must not be extravagated, if it
638         is not running, there must not be bounds, the total number of events in
639         the system must be counted and must be controlled throughout the tests.
640         That the test required the additional update was probably nonsense,
641         because aggregate can cut pieces too. FIXED & DONE
643 2008-09-23  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
645         * rrr-aggregate seems to rewrite the RECENT file even if nothing has
646         changed. FIXED
648 2008-09-21  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
650         * Most apparent bug at the moment is that the recentfiles are fetched
651         too often. Only the principal should be fetched and if it has not
652         changed, the others should not be refetched. ATM I must admit that I'm
653         happy that we refetch more often than needed because I can more easily
654         fix bugs while the thing is running.
656         * Let's say, 1220474966.19501 is a timestamp of a file that is already
657         done but the done system does not know about it. The reason for the
658         failure is not known and we never reach the status uptodate because of
659         this. We must get over it.
661         Later it turns out that the origin server had a bug somewhere.
662         1220474966.19042 came after 1220474966.19501. Or better: it was in the
663         array of the recentfile one position above. The bug was my own.
665 2008-09-20  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
667         * There is the race condition where the server does a delete and the
668         slave does not yet know and then tries to download it because he sees
669         the new. So for this time window we must be more tolerant against
670         failure. If we cannot download a file, we should just skip it and should
671         not retry immediately. The whole system should discover the lost thing
672         later. Keeping track with the DONE system should really be a no brainer.
674         But there is something more: the whole filesystem is a database and the
675         recentfiles are one possible representation of it. It's a pretty useful
676         representation I think that's why I have implemented something around
677         it. But for strictly local operation it has little value. For local
678         operation we would much rather have a database. So we would enter every
679         recentfile reading and every rsync operation and for every file the last
680         state change and what it leads to. Then we would always ignore older
681         records without the efforts involved with recentfiles.
683         The database would have: path,recentepoch,rsyncedon,deletedon
685         Oh well, not yet clear where this leads to.
687 2008-09-19  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
689         * Bug: the bigloop ran into a funny endless loop after EWILHELM uploaded
690         Module-Build. It *only* rsynced the "1h" recentfile from that moment on.
692         * statusfile, maybe only on demand, alone to have a sharp debugging
693         tool. It is locked and all recentfiles dump themselves into it and we
694         can build a viewer that lets us know where we stand and what's inside.
696         * remember: only the principal recentfile needs expiration, all others
697         shall be expired by principal if it discovers that something has move
698         upstream.
700 2008-09-18  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
702         * Always check if we stringify to a higher value than in the entry
703         before. DONE
705         * And in covered make an additional check if we would be able to see a
706         numerical difference between the two numbers and if we can't then switch
707         to a different, more expensive algorithm. Do not want to be caught by
708         floating surprises. DONE
710 2008-09-17  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
712         * caching has several aspects here: we can cache the interval of the
713         recentfile which only will change when the mtime of the file changes. We
714         must re-mirror the recentfile when its ttl has expired. Does have_read
715         tell you anything? It counts nothing at all. Only the mtime is
716         interesting. The ntuple mtime, low-epoch, high-epoch. And as a separate
717         thing the have_mirrored because it is unrelated to the mtime.
719         * Robustness of floating point calculations! I always thought that the
720         string calculated by the origin server for the floating representation
721         of the epoch time is just a string. When we convert it to a number and
722         later back to a string, the other computer might come to a different
723         conclusion. This must not happen, we want to preserve it under any
724         circumstances. I will have to write tests with overlong sequences that
725         get lost in arithmetic and must see if all still works well. DONE
727         But one fragile point remains: if one host considers a>b and the other
728         one considers them == but no eq. To prevent this, we must probably do
729         some extra homework. DONE
731 2008-09-16  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
733         * the concept of tracking DONE needs an object per recentfile that has
734         something like these methods:
736         do_we_have(xxx), we_have(xxx), do_we_have_all(xxx,yyy), reset()
738         covered()        register()    covered()
740         The unclear thing is how we translate points in time into intervals. We
741         could pass a reference to the current recent_events array when running
742         we_have(xxx) and let the DONE object iterate over it such that it only
743         has to store a list of intervals that can melt into each other. Ah, even
744         passing the list together with a list of indexes seems feasiable.
746         Or maybe ask for the inverted list?
748         Whenever the complete array is covered by the interval we say we are
749         fully covered and if the recentfile is not expired, we are uptodate.
751 2008-09-07  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
753 2008-09-05  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
755         * need a way to "return" the next entry after the end of a list. When
756         the caller says "before" or "after" we would like to know if he could
757         cover that interval/threshold or not because this influences the effect
758         of a newer timestamp of that recentfile. DONE with $opt{info}.
760 2008-09-04  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
762         * one of the next things to tackle: the equivalent of csync2 -TIXU.
764         loop implies tixu (?). Nope, something like --statefile decides. Per
765         default we do ...?
767         T test, I init, X including removals, U nodirtymark
769         So we have no concept of dirtymarks, we only trust that since we are
770         running we have observed everything steadily. But people will not let
771         this program run forever so we must consider both startup penalty and
772         book keeping for later runs. We keep this for later. For now we write a
773         long running mirror that merges several intervals.
775 2008-09-02  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
777         * need to speed up the 02 test, it's not clever to sleep so much. Reduce
778         the intervals!
780         * rersyncrecent, the script: default to one week. The name of the switch
781         is --after. Other switches? --loop!
783 2008-08-30  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
785         * need a switch --skip-deletes (?)
787         * need a switch --enduser that tells us that the whole tempfile
788         discipline is not needed when there is no downstream user. (?)
790         Without this switch we cannot have a reasonable recent.pl that just
791         displays the recent additions. Either we accept to download everything.
792         Or we download temporary files without the typical rsync protocol
793         advantages.
795         Or maybe the switch is --tmpdir? If --tmpdir would mean: do not use
796         File::Temp::tempdir, this might be a win.
798 2008-08-29  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
800         * apropos missing: we have no push, we never know the downstream
801         servers. People who know their downstream hosts and want to ascertain
802         something will want additional methods we have never thought about, like
803         update or delete a certain file.
805 2008-08-26  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
807         * tempted to refactor rmirror into resolve_symlink, localize, etc.
808         Curious if rsync_options=links equal 0 vs. 1 will make the expected
809         difference.
811         * rsync options: it's a bit of a pain that we usually need several rsync
812         options, like compress, links, times, checksum and that there is no
813         reasonable default except the original rsync default. I think wee can
814         safely assume that the rsync options are shared between all recentfile
815         instances within one recent tree.
817 2008-08-20  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
819         * deletes: if a delete follows an add quickly enough it may happen that
820         a downstream mirror did not see the add at all! It seems this needs to
821         be mentioned somewhere. The point here is that even if the downstream is
822         never missing the principal timeframe it may encounter a "delete" that
823         has no complimentary "add" anywhere.
825 2008-08-19  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
827         * I suspect the treat of metadata is incorrect during read or something.
828         The bug that I am watching is that between 06:08 and 06:09 the 6h file
829         contained more than 6 hours worth of data. At 06:08 we merged into the
830         1d file. We need to take snapshots of the 6h file over the course of an
831         hour or maybe only between XX:08 and XX:09? Nope, the latter is not
832         enough.
834         Much worse: watching the 1h file: right at the moment (at 06:35) it
835         covers 1218867584-1219120397 which is 70 hours.
837         Something terribly broken. BTW, 1218867584 corresponds to Sat Aug 16
838         08:19:44 2008, that is when I checked out last time, so it seems to be
839         aggregating and never truncating?
841         No, correct is: it is never truncating; but wrong is: it is aggregating.
842         It does receive a lot of events from time to time from a larger file.
843         Somehow a large file gets merged into the small one and because the
844         "meta/merged" attribute is missing, nobody is paying attention. I
845         believe that I can fix this by making sure that metadata are honoured
846         during read. DONE and test adjusted.
848 2008-08-17  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
850         * grand renaming plan
852         remotebase          => remoteroot   to fit well with localroot        DONE
853         local_path()        => localroot    seems to me should already work   DONE
854         recentfile_basename => rfilename    no need to stress it has no slash DONE
856         filenameroot??? Doesn't seem too bad to me today. Maybe something like
857         kern? It would anyway need a deprecation cycle because it is an
858         important constructor.
860         * I like the portability that Data::Serializer brings us but the price
861         is that some day we might find out that it is slowing us a bit. We'll
862         see.
864 2008-08-16  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
866         * should we not enter the interval of the principal (or the interval of
867         the merging file?) in every aggregated/merged file?
869         * we should aim at a first release and give up on thinking about
870         sanitizing stuff and zloop. Let's just admit that a full traditional
871         rsync is the only available sanitizer ATM. Otherwise it's complicated
872         stuff: sanitizing on the origin server, sanitizing on the slaves,
873         sanitizing forgotten files, broken timestamps, etc. Let's delay it and
874         get the basics out before this becomes a major cause for mess.
876 2008-08-13  Andreas Koenig  <k@andreas-koenigs-computer.local>
878         * On OSes not supporting symlinks we expect that RECENT.recent contains
879         the contents of the principal recentfile. Actually this is identical on
880         systems supporting symlinks. Simple, what follows from that is that we
881         need to keep the serializer in the metadata because we cannot read it
882         from the filename, doesn't it? Of course not. It's a chicken and egg
883         problem. This leaves us with the problem to actually parse the
884         serialized data to find out in which format it is. So who can do the 4
885         or 5 magics we wanted to support? File::LibMagic?
887 2008-08-09  Andreas Koenig  <k@andreas-koenigs-computer.local>
889         * remotebase and recentfile_basename are ugly names. Now that we need a
890         word for the shortest/principal/driving recentfile too we should do
891         something about it.
893         localroot is good. rfile is good. local_path() is bad, local_path($path)
894         is medium, filenameroot() is bad, remotebase is bad, recentfile is
895         already deprecated.
897         Up to now remotebase was the string that described the remote root
898         directory in rsync notation, like pause.perl.org::authors. And
899         recentfile_basename was "RECENT-1h.yaml".
901 2008-08-08  Andreas Koenig  <k@andreas-koenigs-computer.local>
903         * The test that was added in today's checkin is a good start for a test
904         of rmirror. We should have more methods in Recent.pm: verify,
905         addmissingfiles. We should verify the current tree, then rmirror it and
906         then verifytree the copy. We could then add some arbitrary file and let
907         it be discovered by addmissingfiles, then rmirror again and then
908         verifytree the copy again.
910         Then we could start stealing from csync2 sqlite database [no port to
911         OSX!] and fill a local DB. And methods to compare the database with the
912         recentfiles. Our strength is that in principle we could maintain state
913         with a single float. We have synced up to 1234567890.123456. If the Z
914         file does not add new files all we have to do is mirror the new ones and
915         delete the goners.
917         This makes it clear that we should extend current protocol and declare
918         that we cheat when we add files too late, just to help the other end
919         keeping track. Ah yes, that's what was meant when zloop was mentioned
920         earlier.
922         Maybe need to revisit File::Mirror to help me with this task.
924 2008-08-07  Andreas Koenig  <k@andreas-koenigs-computer.local>
926         * There must be an allow-me-to-truncate flag in every recentfile.
927         Without it one could construct a sequence of updates winning the locking
928         battle against the aggregator. Only if an aggregator has managed to
929         merge data over to the next level, truncating can be allowed. DONE with
930         accessor merged.
932 2008-08-06  Andreas Koenig  <k@andreas-koenigs-computer.local>
934         * We should probably guarantee that no duplicates enter the aggregator
935         array.
937 2008-08-02  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
939         * To get merge operation faster would need a good benchmark test. What
940         02 spits out isn't reliable enough and is dominated by many other
941         things. Between
943         commit 10176bf6b79865d4fe9f46e3857a3b8669fa7961
944         Author: Andreas J. Koenig <k@k75.(none)>
945         Date:   Sat Aug 2 07:58:04 2008 +0200
947         and
949         commit 3243120a0c120aaddcd9b1f4db6689ff12ed2523
950         Author: Andreas J. Koenig <k@k75.(none)>
951         Date:   Sat Aug 2 11:40:29 2008 +0200
953         there was a lot of trying but the effect is hardly measurable with
954         current tests.  
956         * overhead of connecting seems high. When setting
957         max_files_per_connection to 1 we see that.
959 2008-08-01  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
961         * 1217622571.0889 - 1217597432.86734 = 25138.2215600014
963         25138.2215600014/3600 = 6.98283932222261
965         It jumps into the eye that this is ~ 7 hours, not ~6, so there seems to
966         be a bug in the aggregator. FIXED
968 2008-07-27  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
970         * e.g. id/Y/YE/YEWENBIN/Emacs-PDE-0.2.16.tar.gz: Do we have it, should
971         we have it, can we mirror it, mirror it!
973         I fear this needs a new class which might be called
974         File::Rsync::Mirror::Recent. It would collect all recentfiles of a kind
975         and treat them as an entity. I realize that a single recentfile may be
976         sufficient for certain tasks and that it is handy for the low level
977         programmer but it is not nice to use. If there is a delete in the 1h
978         file then the 6h file still contains it. Seekers of the best information
979         need to combine at least some of the recentfiles most of the time.
981         There is the place for the Z loop!
983         But the combination is something to collect in a database, isn't it. Did
984         csync2 just harrumph?
986 2008-07-26  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
988         * it just occurred to me that hosts in the same mirroring pool could
989         help out each other even without rewriting the recentfile. Just fetch
990         the stuff to mirror from several places, bingo. But that's something
991         that should rather live in a separate package or in rsync directly.
993         * cronjobs are unsuited because with ntp they would all come at the full
994         minute and disturb each other. Besides that I'd hate to have a backbone
995         with more than a few seconds latency.
997 2008-07-25  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
999         * a second rsync server with access control for PAUSE. Port? 873 is the
1000         standard port, let's take 8873.
1002         * if there were a filesystem based on this, it would have a slow access
1003         to inexistent files. It would probably provide wrong readdir (only based
1004         on current content) or also a slow one (based on a recentfile written
1005         after the call). But it would provide fast access to existing files. Or
1006         one would deliberately allow slightly blurred answers based on some
1007         sqlite reflection of the recentfiles.
1009         * todo: write a variant of mirror() that combines two or more
1010         recentfiles and treats them like one
1012         * todo: signal handler to remove the tempfile
1014 2008-07-24  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
1016         * now that we have the symlink I forgot how it should be used in
1017         practice.
1019         * the z loop: add missing files to Z file. Just append them (instead of
1020         prepending). So one guy prepends something from the Y file from time to
1021         time and another guy appends something rather frequently. Collecting
1022         pond. When Y merges into Z, things get epoch and the collecting pond
1023         gets smaller. What exactly are "missing files"?
1025         take note of current epoch of the alpha file, let's call it the
1026         recent-ts
1028         find all files on disk
1030         remove all files registered in the recentworld up to recent-ts
1032         remove all files that have been deleted after recent-ts according to
1033         recentworld
1035 2008-07-23  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
1037         * rersyncrecent might be a cronjob with a (locked) state file which
1038         contains things like after and maybe last z sync or such?
1040         rrr-mirror might be an alternative name but how would we justify the
1041         three Rs when there is no Re-Rsync-Recent?
1043         With the --loop parameter it is an endless loop, without it is no loop.
1044         At least this is simple.
1046         * todo: new accssor z-interval specifies how often the Z file is updated
1047         against the filesystem. We probably want no epoch stamp on these
1048         entries. And we want to be able to filter the entries (e.g. no
1049         by-modules and by-category tree)
1051 2008-07-20  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
1053         * Fill the Z file. gc or fsck or both. Somehow we must get the old files
1054         into Z. We do not need the other files filled up with filesystem
1055         contents though.
1057         * need interface to query for a file in order to NOT call update on
1058         PAUSE a second time within a short time.
1060 2008-07-19  Andreas J. Koenig  <andreas.koenig.7os6VVqR@franz.ak.mind.de>
1062         * recommended update interval? Makes no sense, is different for
1063         different users.
1065         * Moosify
1067         Local Variables:
1068         mode: change-log
1069         change-log-default-name: "Todo"
1070         tab-width: 2
1071         left-margin: 2
1072         End: