(sending to the list)<div><br></div><div>Yes, that sounds like a bug.</div><div><br></div><div>Who's maintaining the GC code?</div><div><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 2:52 PM, Struan Bartlett <span dir="ltr"><<a href="mailto:struan.bartlett@newsnow.co.uk">struan.bartlett@newsnow.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi Brad,<br>
<br>
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?<br>
<br>
Kind regards,<br>
<br>
Struan Bartlett<br>
<br>
-------- Original Message --------
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th align="right" nowrap valign="baseline">Subject: </th>
<td>brackup/delete_backup/gc doesn't round-trip - serious bug?</td>
</tr>
<tr>
<th align="right" nowrap valign="baseline">Date: </th>
<td>Sat, 08 Nov 2008 16:33:59 +0000</td>
</tr>
<tr>
<th align="right" nowrap valign="baseline">From: </th>
<td>Struan Bartlett <a href="mailto:struan.bartlett@NewsNow.co.uk" target="_blank"><struan.bartlett@NewsNow.co.uk></a></td>
</tr>
<tr>
<th align="right" nowrap valign="baseline">To: </th>
<td><a href="mailto:brackup@lists.danga.com" target="_blank">brackup@lists.danga.com</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>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.
(<a href="http://search.cpan.org/~bradfitz/Brackup/lib/Brackup/InventoryDatabase.pm" target="_blank">http://search.cpan.org/~bradfitz/Brackup/lib/Brackup/InventoryDatabase.pm</a>
describes the impact of this issue).
My test case is below. I have written a patch that seems to fix the
problem at
<a href="http://praguespringpeople.net/Software/Brackup/004-brackup-wipe_on_gc-bugfix.patch" target="_blank">http://praguespringpeople.net/Software/Brackup/004-brackup-wipe_on_gc-bugfix.patch</a>.
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
</pre>
</div>
</blockquote></div><br></div>