[Checkins] SVN: gocept.zeoraid/branches/dirceu-addstoragetool/ back out changes that went to the wrong branch

Christian Theune ct at gocept.com
Sat Aug 30 19:41:40 EDT 2008


Log message for revision 90624:
  back out changes that went to the wrong branch
  

Changed:
  U   gocept.zeoraid/branches/dirceu-addstoragetool/base.cfg
  _U  gocept.zeoraid/branches/dirceu-addstoragetool/externals/
  U   gocept.zeoraid/branches/dirceu-addstoragetool/src/gocept/zeoraid/storage.py

-=-
Modified: gocept.zeoraid/branches/dirceu-addstoragetool/base.cfg
===================================================================
--- gocept.zeoraid/branches/dirceu-addstoragetool/base.cfg	2008-08-30 18:58:28 UTC (rev 90623)
+++ gocept.zeoraid/branches/dirceu-addstoragetool/base.cfg	2008-08-30 23:41:39 UTC (rev 90624)
@@ -73,6 +73,5 @@
 
 [zodbscripts]
 recipe = zc.recipe.egg:scripts
-interpreter = py
 eggs = ZODB3
        gocept.zeoraid


Property changes on: gocept.zeoraid/branches/dirceu-addstoragetool/externals
___________________________________________________________________
Name: svn:externals
   - ZODB svn://svn.zope.org/repos/main/ZODB/trunk

   + ZODB svn://svn.zope.org/repos/main/ZODB/branches/gocept-iteration/


Modified: gocept.zeoraid/branches/dirceu-addstoragetool/src/gocept/zeoraid/storage.py
===================================================================
--- gocept.zeoraid/branches/dirceu-addstoragetool/src/gocept/zeoraid/storage.py	2008-08-30 18:58:28 UTC (rev 90623)
+++ gocept.zeoraid/branches/dirceu-addstoragetool/src/gocept/zeoraid/storage.py	2008-08-30 23:41:39 UTC (rev 90624)
@@ -1,4 +1,4 @@
-#/home/ctheune/Development/ZODB/trunk#############################################################################
+##############################################################################
 #
 # Copyright (c) 2007-2008 Zope Foundation and contributors.
 # All Rights Reserved.
@@ -83,6 +83,12 @@
     # we bring them back into the pool of optimal storages.
     _db = None
 
+    # The last transaction that we know of. This is used to keep a global
+    # knowledge of the current assumed state and verify storages that might
+    # have fallen out of sync. It is also used as a point of reference
+    # for generating new TIDs.
+    _last_tid = None
+
     def __init__(self, name, openers, read_only=False, blob_dir=None,
                  shared_blob_dir=False):
         self.__name__ = name
@@ -133,8 +139,8 @@
                 "Can't start without at least one working storage.")
 
         # Set up list of optimal storages
-        last_tid = max(tids)
-        self.storages_optimal = tids.pop(last_tid)
+        self._last_tid = max(tids)
+        self.storages_optimal = tids.pop(self._last_tid)
 
         # Set up list of degraded storages
         self.storages_degraded = []
@@ -188,7 +194,9 @@
 
     def lastTransaction(self):
         """Return the id of the last committed transaction."""
-        return self._apply_single_storage('lastTransaction')[0]
+        if self.raid_status() == 'failed':
+            raise gocept.zeoraid.interfaces.RAIDError('RAID is failed.')
+        return self._last_tid
 
     def __len__(self):
         """The approximate number of objects in the storage."""
@@ -312,7 +320,7 @@
 
             if tid is None:
                 # No TID was given, so we create a new one.
-                tid = self._new_tid(self.lastTransaction())
+                tid = self._new_tid(self._last_tid)
             self._tid = tid
 
             self._apply_all_storages('tpc_begin',
@@ -337,6 +345,7 @@
                     # ClientStorage contradict each other and the documentation
                     # is non-existent. We trust ClientStorage here.
                     callback(self._tid)
+                self._last_tid = self._tid
                 return self._tid
             finally:
                 self._transaction = None



More information about the Checkins mailing list