← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~mterry/duplicity/early-catch-498933 into lp:duplicity

 

Michael Terry has proposed merging lp:~mterry/duplicity/early-catch-498933 into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~mterry/duplicity/early-catch-498933/+merge/72607

This is a stop-gap measure for bug 498933.  Since we can't reproduce, and most people that normally discover the bug do it months or years after the actual bug happened, it seems wise to add code to detect the bug as it happens.

This way, users won't mistakenly think their backup is safe, and hopefully we can get some good data in the bug from users that are able to actually hit the bug itself, not just the symptoms.
-- 
https://code.launchpad.net/~mterry/duplicity/early-catch-498933/+merge/72607
Your team duplicity-team is requested to review the proposed merge of lp:~mterry/duplicity/early-catch-498933 into lp:duplicity.
=== modified file 'duplicity-bin'
--- duplicity-bin	2011-08-23 13:37:06 +0000
+++ duplicity-bin	2011-08-23 17:32:34 +0000
@@ -232,6 +232,20 @@
                    log.ErrorCode.restart_file_not_found)
     return 0
 
+def confirm_volumes_exist(num_vols, backup_type):
+    # Confirm that we did in fact write all the files (this is a sanity check
+    # to catch bug https://launchpad.net/bugs/498933 before it's too late)
+    remlist = globals.backend.list()
+
+    vol = 1
+    while vol <= num_vols:
+        fn = file_naming.get(backup_type, vol,
+                             encrypted=globals.encryption,
+                             gzipped=not globals.encryption)
+        if fn not in remlist:
+            log.FatalError(_("Not all volumes were successfully written. You should create a new full backup.\nIf this is reproducable, please report to https://launchpad.net/bugs/498933";),
+                           log.ErrorCode.volume_missing)
+        vol += 1
 
 def write_multivol(backup_type, tarblock_iter, man_outfp, sig_outfp, backend):
     """
@@ -364,6 +378,8 @@
     for waiter in async_waiters:
         bytes_written += waiter()
 
+    confirm_volumes_exist(vol_num, backup_type)
+
     # Upload the collection summary.
     #bytes_written += write_manifest(mf, backup_type, backend)
 

=== modified file 'duplicity/log.py'
--- duplicity/log.py	2011-05-31 18:07:07 +0000
+++ duplicity/log.py	2011-08-23 17:32:34 +0000
@@ -189,6 +189,7 @@
     gio_not_available = 40
     source_dir_mismatch = 42 # 41 is reserved for par2
     ftps_lftp_missing = 43
+    volume_missing = 44
 
     # 50->69 reserved for backend errors
     backend_error = 50


Follow ups