gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] [BUG] can get duplicate explicit IDs if adding fast


From: Jonathan Geisler
Subject: Re: [Gnu-arch-users] [BUG] can get duplicate explicit IDs if adding fast enough
Date: Wed, 19 May 2004 09:15:00 -0500
User-agent: Mutt/1.5.6i

On Tue, May 18, 2004 at 05:03:52PM -0400, Aaron Bentley wrote:
> Colin Walters wrote:
> >Hi,
> >
> >A better explicit ID algorithm is needed.  Currently if you add files
> >fast enough, it's possible to get two files with the same ID, since the
> >current algorithm just uses the time, basically.
> >
> >Maybe we could switch to just original file path and SHA1 sum?
> 
> That just changes the conditions under which you get duplicate IDs to
> 
> $ touch foo
> $ tla add-id foo
> $ tla mv foo bar
> $ touch foo
> $ tla add-id foo
> 
> (two empty files would have the same SHA1 sum)
> 
> Also, files don't necessarily exist when added.  (treat as empty? worse!)
> Also, SHA1 support hasn't been merged yet.
> 
> There's a very simple way to get a guaranteed unique ID; use a sequence 
> number.  This would require an extra file (with locking protocol), or 
> else a tree-inventory for every add.

And to truly work across branches, this would require the locking
protocol to take into account adds being made in any location and
therefore some sort of centralized server to pass out these unique
IDs.  It seems that uuidgen is the best solution due to the lower
chances of an ID collision.

                                                -- Jonathan Geisler --

Attachment: pgp7_wR10bHSu.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]