Merge ChangeSet@1.10: Documentation about flist scalabilityTODO
[rsync/rsync.git] / TODO
1 -*- indented-text -*-
2
3 URGENT ---------------------------------------------------------------
4
5
6 IMPORTANT ------------------------------------------------------------
7
8 Cross-test versions
9
10   Part of the regression suite should be making sure that we don't
11   break backwards compatibility: old clients vs new servers and so
12   on.  Ideally we would test the cross product of versions.  
13
14   It might be sufficient to test downloads from well-known public
15   rsync servers running different versions of rsync.  This will give
16   some testing and also be the most common case for having different
17   versions and not being able to upgrade.
18
19 use chroot
20
21   If the platform doesn't support it, then don't even try.
22
23   If running as non-root, then don't fail, just give a warning.
24   (There was a thread about this a while ago?)
25
26     http://lists.samba.org/pipermail/rsync/2001-August/thread.html
27     http://lists.samba.org/pipermail/rsync/2001-September/thread.html
28
29 --files-from
30
31   Avoids traversal.  Better option than a pile of --include statements
32   for people who want to generate the file list using a find(1)
33   command or a script.
34
35 Performance
36
37   Traverse just one directory at a time.  Tridge says it's possible.
38
39   At the moment rsync reads the whole file list into memory at the
40   start, which makes us use a lot of memory and also not pipeline
41   network access as much as we could.
42
43   We need to be careful of duplicate names getting into the file list.
44   See clean_flist().  This could happen if multiple arguments include
45   the same file.  Bad.
46
47   I think duplicates are only a problem if they're both flowing
48   through the pipeline at the same time.  For example we might have
49   updated the first occurrence after reading the checksums for the
50   second.  So possibly we just need to make sure that we don't have
51   both in the pipeline at the same time.  
52
53   Possibly if we did one directory at a time that would be sufficient.
54
55   Alternatively we could pre-process the arguments to make sure no
56   duplicates will ever be inserted.  There could be some bad cases
57   when we're collapsing symlinks.
58
59   We could have a hash table.
60
61   The root of the problem is that we do not want more than one file
62   list entry referring to the same file.  At first glance there are
63   several ways this could happen: symlinks, hardlinks, and repeated
64   names on the command line.
65
66   If names are repeated on the command line, they may be present in
67   different forms, perhaps by traversing directory paths in different
68   ways, traversing paths including symlinks.  Also we need to allow
69   for expansion of globs by rsync.
70
71   At the moment, clean_flist() requires having the entire file list in
72   memory.  Duplicate names are detected just by a string comparison.
73
74   We don't need to worry about hard links causing duplicates because
75   files are never updated in place.  Similarly for symlinks.
76
77   I think even if we're using a different symlink mode we don't need
78   to worry.
79
80 Memory accounting
81
82   At exit, show how much memory was used for the file list, etc.
83
84   Also we do a wierd exponential-growth allocation in flist.c.  I'm
85   not sure this makes sense with modern mallocs.  At any rate it will
86   make us allocate a huge amount of memory for large file lists.
87
88 Hard-link handling
89
90   At the moment hardlink handling is very expensive, so it's off by
91   default.  It does not need to be so.  
92
93   We can rule out hardlinked directories since they will probably
94   screw us up in all kinds of ways.  They simply should not be used.
95
96   At the moment rsync only cares about hardlinks to regular files.  I
97   guess you could also use them for sockets, devices and other beasts,
98   but I have not seen them.
99
100   When trying to reproduce hard links, we only need to worry about
101   files that have more than one name (nlinks>1 && !S_ISDIR). 
102
103   The basic point of this is to discover alternate names that refer to
104   the same file.  All operations, including creating the file and
105   writing modifications to it need only to be done for the first name.
106   For all later names, we just create the link and then leave it
107   alone.
108
109   If hard links are to be preserved:
110
111     Before the generator/receiver fork, the list of files is received
112     from the sender (recv_file_list), and a table for detecting hard
113     links is built.
114
115     The generator looks for hard links within the file list and does
116     not send checksums for them, though it does send other metadata.
117
118     The sender sends the device number and inode with file entries, so
119     that files are uniquely identified.
120
121     The receiver goes through and creates hard links (do_hard_links)
122     after all data has been written, but before directory permissions
123     are set.
124
125   At the moment device and inum are sent as 4-byte integers, which
126   will probably cause problems on large filesystems.  On Linux the
127   kernel uses 64-bit ino_t's internally, and people will soon have
128   filesystems big enough to use them.  We ought to follow NFS4 in
129   using 64-bit device and inode identification, perhaps with a
130   protocol version bump.
131
132   Once we've seen all the names for a particular file, we no longer
133   need to think about it and we can deallocate the memory.
134
135   We can also have the case where there are links to a file that are
136   not in the tree being transferred.  There's nothing we can do about
137   that.  Because we rename the destination into place after writing,
138   any hardlinks to the old file are always going to be orphaned.  In
139   fact that is almost necessary because otherwise we'd get really
140   confused if we were generating checksums for one name of a file and
141   modifying another.
142
143   At the moment the code seems to make a whole second copy of the file
144   list, which seems unnecessary.
145
146   We should have a test case that exercises hard links.  Since it
147   might be hard to compare ./tls output where the inodes change we
148   might need a little program to check whether several names refer to
149   the same file.
150
151 IPv6
152
153   Implement suggestions from http://www.kame.net/newsletter/19980604/
154   and ftp://ftp.iij.ad.jp/pub/RFC/rfc2553.txt
155
156   If a host has multiple addresses, then listen try to connect to all
157   in order until we get through.  (getaddrinfo may return multiple
158   addresses.)  This is kind of implemented already.
159
160   Possibly also when starting as a server we may need to listen on
161   multiple passive addresses.  This might be a bit harder, because we
162   may need to select on all of them.  Hm.
163
164   Define a syntax for IPv6 literal addresses.  Since they include
165   colons, they tend to break most naming systems, including ours.
166   Based on the HTTP IPv6 syntax, I think we should use
167  
168      rsync://[::1]/foo/bar
169      [::1]::bar
170
171   which should just take a small change to the parser code.
172
173 Errors
174
175   If we hang or get SIGINT, then explain where we were up to.  Perhaps
176   have a static buffer that contains the current function name, or
177   some kind of description of what we were trying to do.  This is a
178   little easier on people than needing to run strace/truss.
179
180   "The dungeon collapses!  You are killed."  Rather than "unexpected
181   eof" give a message that is more detailed if possible and also more
182   helpful.  
183
184 File attributes
185
186   Device major/minor numbers should be at least 32 bits each.  See
187   http://lists.samba.org/pipermail/rsync/2001-November/005357.html
188
189   Transfer ACLs.  Need to think of a standard representation.
190   Probably better not to even try to convert between NT and POSIX.
191   Possibly can share some code with Samba.
192
193 Empty directories
194
195   With the current common --include '*/' --exclude '*' pattern, people
196   can end up with many empty directories.  We might avoid this by
197   lazily creating such directories.
198
199 zlib
200
201   Perhaps don't use our own zlib.  Will we actually be incompatible,
202   or just be slightly less efficient?
203
204 logging
205
206   Perhaps flush stdout after each filename, so that people trying to
207   monitor progress in a log file can do so more easily.  See
208   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48108
209
210 rsyncd over ssh
211
212   There are already some patches to do this.
213
214 PLATFORMS ------------------------------------------------------------
215
216 Win32
217
218   Don't detach, because this messes up --srvany.
219
220   http://sources.redhat.com/ml/cygwin/2001-08/msg00234.html
221
222   According to "Effective TCP/IP Programming" (??) close() on a socket
223   has incorrect behaviour on Windows -- it sends a RST packet to the
224   other side, which gives a "connection reset by peer" error.  On that
225   platform we should probably do shutdown() instead.  However, on Unix
226   we are correct to call close(), because shutdown() discards
227   untransmitted data.
228
229 DOCUMENTATION --------------------------------------------------------
230
231 Update README
232
233 BUILD FARM -----------------------------------------------------------
234
235 Add machines
236
237   AMDAHL UTS (Dave Dykstra)
238
239   Cygwin (on different versions of Win32?)
240
241   HP-UX variants (via HP?)
242
243   SCO
244
245 NICE -----------------------------------------------------------------
246
247 SIGHUP
248
249   Re-read config file (just exec() ourselves) rather than exiting.
250
251 --no-detach and --no-fork options
252
253   Very useful for debugging.  Also good when running under a
254   daemon-monitoring process that tries to restart the service when the
255   parent exits.
256
257 hang/timeout friendliness
258
259 verbose output
260   
261   Indicate whether files are new, updated, or deleted
262
263 internationalization
264
265   Change to using gettext().  Probably need to ship this for platforms
266   that don't have it.  
267
268   Solicit translations.
269
270   Does anyone care?
271
272 rsyncsh 
273
274    Write a small emulation of interactive ftp as a Pythonn program
275    that calls rsync.  Commands such as "cd", "ls", "ls *.c" etc map
276    fairly directly into rsync commands: it just needs to remember the
277    current host, directory and so on.  We can probably even do
278    completion of remote filenames.
279
280 %K%