[Erp5-report] r25867 - /erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 4 15:36:28 CET 2009


Author: luke
Date: Wed Mar  4 15:36:24 2009
New Revision: 25867

URL: http://svn.erp5.org?rev=25867&view=rev
Log:
 - do not allow to proceed with restoration if cutting is requested and index file exists, as bug in ZODB will prevent cutting at given transaction id

Modified:
    erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py

Modified: erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py
URL: http://svn.erp5.org/erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py?rev=25867&r1=25866&r2=25867&view=diff
==============================================================================
--- erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py [utf8] (original)
+++ erp5/trunk/products/TIDStorage/repozo/repozo_tidstorage.py [utf8] Wed Mar  4 15:36:24 2009
@@ -108,6 +108,17 @@
   """Recovers all ZODB files, when last_tid_dict is passed cut them at proper byte"""
   recovered_count = 0
   total_count = len(known_tid_storage_identifier_dict)
+  result = 0
+  for key, (file_path, storage_path, object_path) in known_tid_storage_identifier_dict.iteritems():
+    # check that indexes do not exists if cut shall be done
+    file_index = file_path + ".index"
+    if os.access(file_index, os.F_OK) and last_tid_dict is not None:
+      log('Error: Index file %s exists. Bug in ZODB makes it impossible to cut'
+          ' indexed file after restore. Cannot continue.' %
+        file_index)
+      result = 1
+  if result:
+    return result
   for key, (file_path, storage_path, object_path) in known_tid_storage_identifier_dict.iteritems():
     if not os.access(storage_path, os.R_OK):
       log('Warning: unable to recover %s because %s is missing/unreadable.' % (file_path, storage_path))




More information about the Erp5-report mailing list