[Zodb-checkins] CVS: ZODB3/Tools - repozo.py:

Tim Peters tim.one at comcast.net
Sun Aug 17 01:25:44 EDT 2003

Update of /cvs-repository/ZODB3/Tools
In directory cvs.zope.org:/tmp/cvs-serv25132/Tools

Modified Files:
      Tag: ZODB3-3_1-branch
Log Message:
do_incremental_backup():  This told copyfile() to copy more bytes than
it actually wanted to copy.  If the Data.fs file grew another transaction
since the time do_incremental_backup() first figured out where to finish
copying, then, more data got written to the incremental file than the
.dat file recorded.  This caused the next attempt to do an incremental
backup to believe the checksums were out of whack, triggering a needless
full backup.

copyfile():  Assert that the number of bytes processed by dofile() is
equal to the number of bytes copyfile() was told to process.  This assert
would have caught the bug above.

=== ZODB3/Tools/repozo.py => ===
--- ZODB3/Tools/repozo.py:	Sat Aug 16 23:57:46 2003
+++ ZODB3/Tools/repozo.py	Sun Aug 17 00:25:36 2003
@@ -232,9 +232,10 @@
     def func(data):
-    dofile(func, ifp, n)
+    ndone = dofile(func, ifp, n)
+    assert ndone == n
     return sum.hexdigest()
@@ -377,7 +378,7 @@
         print >> sys.stderr, 'Cannot overwrite existing file:', dest
     log('writing incremental: %s bytes to %s',  pos-reposz, dest)
-    sum = copyfile(options, dest, reposz, pos)
+    sum = copyfile(options, dest, reposz, pos - reposz)
     # The first file in repofiles points to the last full backup.  Use this to
     # get the .dat file and append the information for this incrementatl to
     # that file.

More information about the Zodb-checkins mailing list