[Top][All Lists]

[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: Aaron Bentley
Subject: Re: [Gnu-arch-users] [BUG] can get duplicate explicit IDs if adding fast enough
Date: Tue, 18 May 2004 17:03:52 -0400
User-agent: Mozilla Thunderbird 0.5 (X11/20040309)

Colin Walters wrote:

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.

Aaron Bentley
Director of Technology
Panometrics, Inc.

reply via email to

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