Commit 40351191 authored by Vincent Pelletier's avatar Vincent Pelletier

Use a set of node rather than a set of cells.

This avoids sending multiple abort messages for each storage node (one per
partition it is assigned to).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2163 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f5a7c859
...@@ -768,17 +768,18 @@ class Application(object): ...@@ -768,17 +768,18 @@ class Application(object):
tid = self.local_var.tid tid = self.local_var.tid
getCellListForOID = self._getCellListForOID getCellListForOID = self._getCellListForOID
# select nodes where transaction was stored # select nodes where transaction was stored
cell_set = set(self._getCellListForTID(tid, node_set = set([x.getNode() for x in self._getCellListForTID(tid,
writable=True)) writable=True)])
# select nodes where objects were stored # select nodes where objects were stored
for oid in self.local_var.data_dict.iterkeys(): for oid in self.local_var.data_dict.iterkeys():
cell_set |= set(getCellListForOID(oid, writable=True)) node_set |= set([x.getNode() for x in getCellListForOID(oid,
writable=True)])
p = Packets.AbortTransaction(tid) p = Packets.AbortTransaction(tid)
getConnForCell = self.cp.getConnForCell getConnForNode = self.cp.getConnForNode
# cancel transaction one all those nodes # cancel transaction one all those nodes
for cell in cell_set: for node in node_set:
conn = getConnForCell(cell) conn = getConnForNode(node)
if conn is None: if conn is None:
continue continue
conn.notify(p) conn.notify(p)
......
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