[Csync2] design question
Giampaolo Tomassoni
g.tomassoni at libero.it
Thu Jan 4 17:55:20 CET 2007
From: Eric Van Buggenhaut [mailto:eric at proyectosolidario.org]
>
> ...omissis...
>
> > Csync2 is meant to keep in synch almost-immutable files and
> > hierarchies (say, your /etc dir and maybe the content from some
> > static web sites). If you need to synch rapidly-changing
> > hirarchies, you'd better to move to some other mean (i.e.: the
> > coda fs or some other network-base redundant fs).
>
> You're totally and using inode number to sync different doesn't make any
> sense but maybe it could be used _before_ sync'ing, when a host marks
> its files as dirty (iow, when sqlite db is updated).
I didn't mean to share i-node numbers between the peers (that wouldn't work even when NFS is not involved), I meant that if you mount an NFS volume and look at the i-node number of a file inside it, then unmount NFS and remount it, you may experience that very same file to have a different i-node number. The i-node number is to be regarded as a volatile file attribute, not a persistent one.
Since csync2 uses a db (right, sqlite) to persist some infos about a given file in order to detect changes in files and hierarchies, if it would use the the i-node number instead of the filepath to accomplish this it would end, in example, with uselessly re-synching whole VFS branches soon after system reboots. This would be due to the fact that a volatile attribute (the i-node number) is persisted in the database and, even worse, used basicly as (part of) a key to uniquely identify the i-nodes.
If you have an app or whatever that needs to rename directories, why don't you use symbolic links instead? Create a "real" directory with a well-unique name, then make a symlink to it with the name you like or need. When you need to access the dir with a different name, just rename the symlink. Csync2 will only delete the symlink having the old name and create a new one with the new name.
Giampaolo
More information about the Csync2
mailing list