[BUG] Another bad garbage collection bug
gavin at openfusion.com.au
Tue Nov 18 00:13:37 UTC 2008
On Mon, Nov 17, 2008 at 09:16:45AM -0800, Martin Atkins wrote:
> Gavin Carr wrote:
>> I've found another bad bug with garbage collection: any target
>> that has the 'nocolons' setting turned on (and it's on by default for both
>> the Ftp and Sftp targets) have their chunks incorrectly compared during
>> garbage collection, with the result that ALL chunks get deleted when you
>> do a gc.
>> The problem is that chunks in the brackup file are recorded with
>> colons, while the chunks on disk are escaped, and then the comparison
>> during garbage collection is just done directly, when
>> one or other of the operands should be converted.
> The simplest fix is probably to unescape to colons again e.g.
> I think this dots-to-colons mapping should happen in the
> Brackup::Target->chunks method. The renaming of colons to dots is an
> implementation detail of the target, but the public Target interface is to
> use colons so the target should apply the opposite mapping when it returns
> a list of chunks for symmetry/consistency.
Yep, that's cleaner. I wasn't sure whether other users of chunks() might
be expecting the physical path rather than the logical one, but it looks
like you're right. Thanks.
More information about the brackup