Commit e0aa8ef3 authored by Julien Muchembled's avatar Julien Muchembled

storage: fix update of outdated partitions when a transaction is finished

All Partition objects must be updated because all of them may contain an object
of the given transaction, even if the transaction itself is stored in another
storage.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2786 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 890a1cef
...@@ -27,8 +27,13 @@ class Partition(object): ...@@ -27,8 +27,13 @@ class Partition(object):
"""This class abstracts the state of a partition.""" """This class abstracts the state of a partition."""
def __init__(self, offset, max_tid, ttid_list): def __init__(self, offset, max_tid, ttid_list):
# Possible optimization:
# _pending_ttid_list & _critical_tid can be shared amongst partitions
# created at the same time (cf Replicator.setUnfinishedTIDList).
# Replicator.transactionFinished would only have to iterate on these
# different sets, instead of all partitions.
self._offset = offset self._offset = offset
self._pending_ttid_list = ttid_list self._pending_ttid_list = set(ttid_list)
# pending upper bound # pending upper bound
self._critical_tid = max_tid self._critical_tid = max_tid
...@@ -212,8 +217,8 @@ class Replicator(object): ...@@ -212,8 +217,8 @@ class Replicator(object):
def transactionFinished(self, ttid, max_tid): def transactionFinished(self, ttid, max_tid):
""" Callback from MasterOperationHandler """ """ Callback from MasterOperationHandler """
partition = self.partition_dict[self.app.pt.getPartition(ttid)] for partition in self.partition_dict.itervalues():
partition.transactionFinished(ttid, max_tid) partition.transactionFinished(ttid, max_tid)
def _askUnfinishedTIDs(self): def _askUnfinishedTIDs(self):
conn = self.app.master_conn conn = self.app.master_conn
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment