Commit d5f7fb10 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Store the partition table in the database when receiving answerPartitionTable

packet instead of checking its state.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@882 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 92138046
......@@ -54,21 +54,21 @@ class InitializationHandler(BaseMasterHandler):
pt.setCell(offset, node, state)
if pt.filled():
# If the table is filled, I assume that the table is ready
# to use. Thus install it into the database for persistency.
cell_list = []
for offset in xrange(app.pt.getPartitions()):
for cell in pt.getCellList(offset):
cell_list.append((offset, cell.getUUID(),
cell.getState()))
app.dm.setPartitionTable(ptid, cell_list)
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
app = self.app
pt = app.pt
assert not row_list
self.app.has_partition_table = True
if not pt.filled():
raise protocol.ProtocolError('Partial partition table received')
logging.debug('Got the partition table :')
self.app.pt.log()
# Install the partition table into the database for persistency.
cell_list = []
for offset in xrange(app.pt.getPartitions()):
for cell in pt.getCellList(offset):
cell_list.append((offset, cell.getUUID(), cell.getState()))
app.dm.setPartitionTable(ptid, cell_list)
self.app.has_partition_table = True
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
# XXX: Currently it safe to ignore those packets because the master is
......
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