]>
Commit | Line | Data |
---|---|---|
46ef7d1d | 1 | -*- indented-text -*- |
a0365806 | 2 | |
46ef7d1d MP |
3 | URGENT --------------------------------------------------------------- |
4 | ||
33d213bb MP |
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 | ||
a2d2e5c0 MP |
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 | ||
8f4455f2 MP |
35 | File list structure in memory |
36 | ||
37 | Rather than one big array, perhaps have a tree in memory mirroring | |
38 | the directory tree. | |
39 | ||
40 | This might make sorting much faster! (I'm not sure it's a big CPU | |
41 | problem, mind you.) | |
42 | ||
43 | It might also reduce memory use in storing repeated directory names | |
44 | -- again I'm not sure this is a problem. | |
0e5a1f83 | 45 | |
a2d2e5c0 MP |
46 | Performance |
47 | ||
48 | Traverse just one directory at a time. Tridge says it's possible. | |
a6a3c3df MP |
49 | |
50 | At the moment rsync reads the whole file list into memory at the | |
51 | start, which makes us use a lot of memory and also not pipeline | |
52 | network access as much as we could. | |
53 | ||
0e5a1f83 MP |
54 | |
55 | Handling duplicate names | |
56 | ||
b3e6c815 | 57 | We need to be careful of duplicate names getting into the file list. |
d2e9d069 MP |
58 | See clean_flist(). This could happen if multiple arguments include |
59 | the same file. Bad. | |
b3e6c815 MP |
60 | |
61 | I think duplicates are only a problem if they're both flowing | |
62 | through the pipeline at the same time. For example we might have | |
63 | updated the first occurrence after reading the checksums for the | |
64 | second. So possibly we just need to make sure that we don't have | |
65 | both in the pipeline at the same time. | |
66 | ||
67 | Possibly if we did one directory at a time that would be sufficient. | |
68 | ||
69 | Alternatively we could pre-process the arguments to make sure no | |
58379559 MP |
70 | duplicates will ever be inserted. There could be some bad cases |
71 | when we're collapsing symlinks. | |
b3e6c815 MP |
72 | |
73 | We could have a hash table. | |
74 | ||
d2e9d069 MP |
75 | The root of the problem is that we do not want more than one file |
76 | list entry referring to the same file. At first glance there are | |
77 | several ways this could happen: symlinks, hardlinks, and repeated | |
78 | names on the command line. | |
79 | ||
80 | If names are repeated on the command line, they may be present in | |
81 | different forms, perhaps by traversing directory paths in different | |
82 | ways, traversing paths including symlinks. Also we need to allow | |
83 | for expansion of globs by rsync. | |
84 | ||
85 | At the moment, clean_flist() requires having the entire file list in | |
86 | memory. Duplicate names are detected just by a string comparison. | |
87 | ||
88 | We don't need to worry about hard links causing duplicates because | |
89 | files are never updated in place. Similarly for symlinks. | |
90 | ||
91 | I think even if we're using a different symlink mode we don't need | |
92 | to worry. | |
93 | ||
0e5a1f83 MP |
94 | Unless we're really clever this will introduce a protocol |
95 | incompatibility, so we need to be able to accept the old format as | |
96 | well. | |
97 | ||
98 | ||
a6a3c3df MP |
99 | Memory accounting |
100 | ||
101 | At exit, show how much memory was used for the file list, etc. | |
102 | ||
b3e6c815 MP |
103 | Also we do a wierd exponential-growth allocation in flist.c. I'm |
104 | not sure this makes sense with modern mallocs. At any rate it will | |
105 | make us allocate a huge amount of memory for large file lists. | |
106 | ||
0e5a1f83 | 107 | |
a6a3c3df MP |
108 | Hard-link handling |
109 | ||
110 | At the moment hardlink handling is very expensive, so it's off by | |
111 | default. It does not need to be so. | |
112 | ||
0e5a1f83 MP |
113 | Since most of the solutions are rather intertwined with the file |
114 | list it is probably better to fix that first, although fixing | |
115 | hardlinks is possibly simpler. | |
116 | ||
a6a3c3df MP |
117 | We can rule out hardlinked directories since they will probably |
118 | screw us up in all kinds of ways. They simply should not be used. | |
119 | ||
120 | At the moment rsync only cares about hardlinks to regular files. I | |
121 | guess you could also use them for sockets, devices and other beasts, | |
122 | but I have not seen them. | |
123 | ||
124 | When trying to reproduce hard links, we only need to worry about | |
125 | files that have more than one name (nlinks>1 && !S_ISDIR). | |
126 | ||
127 | The basic point of this is to discover alternate names that refer to | |
128 | the same file. All operations, including creating the file and | |
129 | writing modifications to it need only to be done for the first name. | |
130 | For all later names, we just create the link and then leave it | |
131 | alone. | |
132 | ||
133 | If hard links are to be preserved: | |
134 | ||
135 | Before the generator/receiver fork, the list of files is received | |
136 | from the sender (recv_file_list), and a table for detecting hard | |
137 | links is built. | |
138 | ||
139 | The generator looks for hard links within the file list and does | |
140 | not send checksums for them, though it does send other metadata. | |
141 | ||
142 | The sender sends the device number and inode with file entries, so | |
143 | that files are uniquely identified. | |
144 | ||
145 | The receiver goes through and creates hard links (do_hard_links) | |
146 | after all data has been written, but before directory permissions | |
147 | are set. | |
148 | ||
149 | At the moment device and inum are sent as 4-byte integers, which | |
150 | will probably cause problems on large filesystems. On Linux the | |
151 | kernel uses 64-bit ino_t's internally, and people will soon have | |
152 | filesystems big enough to use them. We ought to follow NFS4 in | |
153 | using 64-bit device and inode identification, perhaps with a | |
154 | protocol version bump. | |
155 | ||
156 | Once we've seen all the names for a particular file, we no longer | |
157 | need to think about it and we can deallocate the memory. | |
158 | ||
159 | We can also have the case where there are links to a file that are | |
160 | not in the tree being transferred. There's nothing we can do about | |
161 | that. Because we rename the destination into place after writing, | |
162 | any hardlinks to the old file are always going to be orphaned. In | |
163 | fact that is almost necessary because otherwise we'd get really | |
164 | confused if we were generating checksums for one name of a file and | |
165 | modifying another. | |
166 | ||
167 | At the moment the code seems to make a whole second copy of the file | |
168 | list, which seems unnecessary. | |
169 | ||
170 | We should have a test case that exercises hard links. Since it | |
171 | might be hard to compare ./tls output where the inodes change we | |
172 | might need a little program to check whether several names refer to | |
173 | the same file. | |
a2d2e5c0 MP |
174 | |
175 | IPv6 | |
176 | ||
c33e3e39 MP |
177 | Implement suggestions from http://www.kame.net/newsletter/19980604/ |
178 | and ftp://ftp.iij.ad.jp/pub/RFC/rfc2553.txt | |
179 | ||
180 | If a host has multiple addresses, then listen try to connect to all | |
181 | in order until we get through. (getaddrinfo may return multiple | |
c10b0bdd | 182 | addresses.) This is kind of implemented already. |
c33e3e39 MP |
183 | |
184 | Possibly also when starting as a server we may need to listen on | |
185 | multiple passive addresses. This might be a bit harder, because we | |
186 | may need to select on all of them. Hm. | |
187 | ||
a2d2e5c0 MP |
188 | Define a syntax for IPv6 literal addresses. Since they include |
189 | colons, they tend to break most naming systems, including ours. | |
190 | Based on the HTTP IPv6 syntax, I think we should use | |
191 | ||
192 | rsync://[::1]/foo/bar | |
193 | [::1]::bar | |
194 | ||
195 | which should just take a small change to the parser code. | |
196 | ||
5aafd07b MP |
197 | Errors |
198 | ||
199 | If we hang or get SIGINT, then explain where we were up to. Perhaps | |
200 | have a static buffer that contains the current function name, or | |
201 | some kind of description of what we were trying to do. This is a | |
202 | little easier on people than needing to run strace/truss. | |
203 | ||
204 | "The dungeon collapses! You are killed." Rather than "unexpected | |
205 | eof" give a message that is more detailed if possible and also more | |
206 | helpful. | |
207 | ||
89b0a3d9 MP |
208 | If we get an error writing to a socket, then we should perhaps |
209 | continue trying to read to see if an error message comes across | |
210 | explaining why the socket is closed. I'm not sure if this would | |
211 | work, but it would certainly make our messages more helpful. | |
212 | ||
5575de14 MP |
213 | File attributes |
214 | ||
215 | Device major/minor numbers should be at least 32 bits each. See | |
216 | http://lists.samba.org/pipermail/rsync/2001-November/005357.html | |
217 | ||
218 | Transfer ACLs. Need to think of a standard representation. | |
219 | Probably better not to even try to convert between NT and POSIX. | |
220 | Possibly can share some code with Samba. | |
5aafd07b | 221 | |
28a69e25 MP |
222 | Empty directories |
223 | ||
224 | With the current common --include '*/' --exclude '*' pattern, people | |
225 | can end up with many empty directories. We might avoid this by | |
226 | lazily creating such directories. | |
227 | ||
c6e27b60 | 228 | |
28a69e25 MP |
229 | zlib |
230 | ||
c6e27b60 MP |
231 | Perhaps don't use our own zlib. |
232 | ||
233 | Advantages: | |
234 | ||
235 | - will automatically be up to date with bugfixes in zlib | |
236 | ||
237 | - can leave it out for small rsync on e.g. recovery disks | |
238 | ||
239 | - can use a shared library | |
240 | ||
241 | - avoids people breaking rsync by trying to do this themselves and | |
242 | messing up | |
243 | ||
244 | Should we ship zlib for systems that don't have it, or require | |
245 | people to install it separately? | |
246 | ||
247 | Apparently this will make us incompatible with versions of rsync | |
248 | that use the patched version of rsync. Probably the simplest way to | |
249 | do this is to just disable gzip (with a warning) when talking to old | |
250 | versions. | |
251 | ||
28a69e25 MP |
252 | |
253 | logging | |
254 | ||
255 | Perhaps flush stdout after each filename, so that people trying to | |
256 | monitor progress in a log file can do so more easily. See | |
257 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48108 | |
258 | ||
430d841a MP |
259 | At the connections that just get a list of modules are not logged, |
260 | but they should be. | |
261 | ||
db1babe6 MP |
262 | If a child of the rsync daemon dies with a signal, we should notice |
263 | that when we reap it and log a message. | |
264 | ||
265 | ||
7c583c73 MP |
266 | rsyncd over ssh |
267 | ||
268 | There are already some patches to do this. | |
269 | ||
92325ada MP |
270 | proxy authentication |
271 | ||
272 | Allow RSYNC_PROXY to be http://user:pass@proxy.foo:3128/, and do | |
273 | HTTP Basic Proxy-Authentication. | |
274 | ||
275 | Multiple schemes are possible, up to and including the insanity that | |
276 | is NTLM, but Basic probably covers most cases. | |
277 | ||
278 | SOCKS | |
279 | ||
280 | Add --with-socks, and then perhaps a command-line option to put them | |
281 | on or off. This might be more reliable than LD_PRELOAD hacks. | |
282 | ||
27741d9f MP |
283 | Better statistics: |
284 | ||
285 | <Rasmus> mbp: hey, how about an rsync option that just gives you the | |
286 | summary without the list of files? And perhaps gives more | |
287 | information like the number of new files, number of changed, | |
288 | deleted, etc. ? | |
289 | <mbp> Rasmus: nice idea | |
290 | <mbp> there is --stats | |
291 | <mbp> but at the moment it's very tridge-oriented | |
292 | <mbp> rather than user-friendly | |
293 | <mbp> it would be nice to improve it | |
294 | <mbp> that would also work well with --dryrun | |
295 | ||
e53fe9a2 MP |
296 | TDB: |
297 | ||
298 | Rather than storing the file list in memory, store it in a TDB. | |
299 | ||
300 | This *might* make memory usage lower while building the file list. | |
301 | ||
302 | Hashtable lookup will mean files are not transmitted in order, | |
303 | though... hm. | |
304 | ||
305 | This would neatly eliminate one of the major post-fork shared data | |
306 | structures. | |
307 | ||
308 | ||
97e1254a MP |
309 | chmod: |
310 | ||
311 | On 12 Mar 2002, Dave Dykstra <dwd@bell-labs.com> wrote: | |
312 | > If we would add an option to do that functionality, I would vote for one | |
313 | > that was more general which could mask off any set of permission bits and | |
314 | > possibly add any set of bits. Perhaps a chmod-like syntax if it could be | |
315 | > implemented simply. | |
316 | ||
317 | I think that would be good too. For example, people uploading files | |
318 | to a web server might like to say | |
319 | ||
320 | rsync -avzP --chmod a+rX ./ sourcefrog.net:/home/www/sourcefrog/ | |
321 | ||
322 | Ideally the patch would implement as many of the gnu chmod semantics | |
323 | as possible. I think the mode parser should be a separate function | |
324 | that passes back something like (mask,set) description to the rest of | |
325 | the program. For bonus points there would be a test case for the | |
326 | parser. | |
327 | ||
328 | ||
a2d2e5c0 MP |
329 | PLATFORMS ------------------------------------------------------------ |
330 | ||
331 | Win32 | |
332 | ||
333 | Don't detach, because this messes up --srvany. | |
334 | ||
335 | http://sources.redhat.com/ml/cygwin/2001-08/msg00234.html | |
336 | ||
337 | According to "Effective TCP/IP Programming" (??) close() on a socket | |
338 | has incorrect behaviour on Windows -- it sends a RST packet to the | |
339 | other side, which gives a "connection reset by peer" error. On that | |
340 | platform we should probably do shutdown() instead. However, on Unix | |
341 | we are correct to call close(), because shutdown() discards | |
342 | untransmitted data. | |
343 | ||
0e23e41d MP |
344 | DEVELOPMENT ---------------------------------------------------------- |
345 | ||
346 | Splint | |
347 | ||
348 | Build rsync with SPLINT to try to find security holes. Add | |
349 | annotations as necessary. Keep track of the number of warnings | |
350 | found initially, and see how many of them are real bugs, or real | |
351 | security bugs. Knowing the percentage of likely hits would be | |
352 | really interesting for other projects. | |
353 | ||
f5a95bb5 MP |
354 | Torture test |
355 | ||
356 | Something that just keeps running rsync continuously over a data set | |
357 | likely to generate problems. | |
358 | ||
359 | Cross-testing | |
360 | ||
361 | Run current rsync versions against significant past releases. | |
362 | ||
43a4dc10 MP |
363 | Memory debugger |
364 | ||
3a79260d | 365 | jra recommends Valgrind: |
43a4dc10 MP |
366 | |
367 | http://devel-home.kde.org/~sewardj/ | |
368 | ||
7c583c73 MP |
369 | DOCUMENTATION -------------------------------------------------------- |
370 | ||
371 | Update README | |
372 | ||
a2d2e5c0 MP |
373 | BUILD FARM ----------------------------------------------------------- |
374 | ||
375 | Add machines | |
376 | ||
377 | AMDAHL UTS (Dave Dykstra) | |
378 | ||
379 | Cygwin (on different versions of Win32?) | |
380 | ||
381 | HP-UX variants (via HP?) | |
33d213bb | 382 | |
5aafd07b MP |
383 | SCO |
384 | ||
46ef7d1d MP |
385 | NICE ----------------------------------------------------------------- |
386 | ||
a2d2e5c0 MP |
387 | --no-detach and --no-fork options |
388 | ||
389 | Very useful for debugging. Also good when running under a | |
390 | daemon-monitoring process that tries to restart the service when the | |
391 | parent exits. | |
392 | ||
393 | hang/timeout friendliness | |
394 | ||
50f2f002 MP |
395 | verbose output |
396 | ||
397 | Indicate whether files are new, updated, or deleted | |
398 | ||
d834adc1 MP |
399 | At end of transfer, show how many files were or were not transferred |
400 | correctly. | |
401 | ||
a2d2e5c0 MP |
402 | internationalization |
403 | ||
404 | Change to using gettext(). Probably need to ship this for platforms | |
405 | that don't have it. | |
406 | ||
407 | Solicit translations. | |
408 | ||
409 | Does anyone care? | |
410 | ||
46ef7d1d MP |
411 | rsyncsh |
412 | ||
413 | Write a small emulation of interactive ftp as a Pythonn program | |
414 | that calls rsync. Commands such as "cd", "ls", "ls *.c" etc map | |
415 | fairly directly into rsync commands: it just needs to remember the | |
416 | current host, directory and so on. We can probably even do | |
417 | completion of remote filenames. |