[Fwd: brackup/delete_backup/gc doesn't round-trip - serious bug?]

Brad Fitzpatrick brad at danga.com
Wed Nov 12 09:57:40 UTC 2008


(sending to the list)
Yes, that sounds like a bug.

Who's maintaining the GC code?

On Tue, Nov 11, 2008 at 2:52 PM, Struan Bartlett <
struan.bartlett at newsnow.co.uk> wrote:

>  Hi Brad,
>
> I hope you're well. Been doing some work on brackup, which I wanted to post
> to the list, but I've had some trouble subscribing to it. I've resubmitted
> my details a couple of times now, but I'm not receiving anything through it
> and I'm not sure my post to the list hasn't just blackholed. Is the list
> still the best place to email a patch to?
>
> Kind regards,
>
> Struan Bartlett
>
> -------- Original Message --------  Subject: brackup/delete_backup/gc
> doesn't round-trip - serious bug?  Date: Sat, 08 Nov 2008 16:33:59 +0000  From:
> Struan Bartlett <struan.bartlett at NewsNow.co.uk><struan.bartlett at NewsNow.co.uk>  To:
> brackup at lists.danga.com
>
> When the 'gc' operation is executed, chunks removed from the target are
> not removed from the inventory. This looks like a bug, because if the
> same chunks need to be stored again, they will not be stored as brackup
> will think they are already on the target.
> (http://search.cpan.org/~bradfitz/Brackup/lib/Brackup/InventoryDatabase.pm
> describes the impact of this issue).
>
> My test case is below. I have written a patch that seems to fix the
> problem at http://praguespringpeople.net/Software/Brackup/004-brackup-wipe_on_gc-bugfix.patch.
> Please let me know if you would like me to submit it anywhere (e.g. to
> Appspot - I would have done this but Appspot takes a while to set up and
> I didn't get great response to my previous patches :-( )
>
> Kind regards,
>
> Struan
>
> [TARGET:test]
> type = Filesystem
> path = /usr/src/Brackup/TARGET
> keep_backups = 10
>
> [SOURCE:test]
> path = /usr/src/Brackup/SOURCE
> noatime = 1
> ignore = ^.brackup-digest.db
>
> # Start with no .db files and empty target
> debian:/usr/src/Brackup# rm -rf TARGET/* SOURCE/.brackup-digest.db
> /root/.brackup-target-test.invdb
> debian:/usr/src/Brackup# ls -ltr $(find SOURCE/ TARGET/ -type f)
> -rw-r--r-- 1 root src 12 Nov  1 13:51 SOURCE/testfile1.txt
> -rw-r--r-- 1 root src  3 Nov  1 14:13 SOURCE/ok.txt
>
> # Run the Brackup
> debian:/usr/src/Brackup# brackup --from=test --to=test
>
> debian:/usr/src/Brackup# ls -ltr $(find SOURCE/ TARGET/ -type f)
> -rw-r--r-- 1 root src   12 Nov  1 13:51 SOURCE/testfile1.txt
> -rw-r--r-- 1 root src    3 Nov  1 14:13 SOURCE/ok.txt
> -rw-r--r-- 1 root src  600 Nov  1 19:02
> TARGET/backups/test-1225566124.brackup
> -rw-r--r-- 1 root src   12 Nov  1 19:02
> TARGET/64/8a/sha1:648a6a6ffffdaa0badb23b8baf90b6168dd16b3a.chunk
> -rw-r--r-- 1 root src    3 Nov  1 19:02
> TARGET/09/fb/sha1:09fb654c17cc05b11ef53bd35aa701f6d550e8e1.chunk
> -rw-r--r-- 1 root src 3072 Nov  1 19:02 SOURCE/.brackup-digest.db
>
> # Examine the inventory db
> debian:/usr/src/Brackup# sqlite3 /root/.brackup-target-test.invdb
> 'select * from target_inv'
> sha1:09fb654c17cc05b11ef53bd35aa701f6d550e8e1;raw|sha1:09fb654c17cc05b11ef53bd35aa701f6d550e8e1
> 3
> sha1:648a6a6ffffdaa0badb23b8baf90b6168dd16b3a;raw|sha1:648a6a6ffffdaa0badb23b8baf90b6168dd16b3a
> 12
>
> # Delete the backup
> debian:/usr/src/Brackup# brackup-target test delete_backup test-1225566124
>
> # Clean up the unused chunks from the target
> debian:/usr/src/Brackup# brackup-target test gc
>
> debian:/usr/src/Brackup# ls -ltr $(find SOURCE/ TARGET/ -type f)
> -rw-r--r-- 1 root src   12 Nov  1 13:51 SOURCE/testfile1.txt
> -rw-r--r-- 1 root src    3 Nov  1 14:13 SOURCE/ok.txt
> -rw-r--r-- 1 root src 3072 Nov  1 19:04 SOURCE/.brackup-digest.db
>
> # Examine the inventory db again - uh oh!
> debian:/usr/src/Brackup# sqlite3 /root/.brackup-target-test.invdb
> 'select * from target_inv'
> sha1:09fb654c17cc05b11ef53bd35aa701f6d550e8e1;raw|sha1:09fb654c17cc05b11ef53bd35aa701f6d550e8e1
> 3
> sha1:648a6a6ffffdaa0badb23b8baf90b6168dd16b3a;raw|sha1:648a6a6ffffdaa0badb23b8baf90b6168dd16b3a
> 12
>
> # Run the Brackup again - do we round trip?
> debian:/usr/src/Brackup# brackup --from=test --to=test
>
> # No, we don't.
> debian:/usr/src/Brackup# ls -ltr $(find SOURCE/ TARGET/ -type f)
> -rw-r--r-- 1 root src   12 Nov  1 13:51 SOURCE/testfile1.txt
> -rw-r--r-- 1 root src    3 Nov  1 14:13 SOURCE/ok.txt
> -rw-r--r-- 1 root src 3072 Nov  1 19:04 SOURCE/.brackup-digest.db
> -rw-r--r-- 1 root src  600 Nov  1 19:06
> TARGET/backups/test-1225566376.brackup
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/brackup/attachments/20081112/50bb44c5/attachment.htm 


More information about the brackup mailing list