Commit 46347845 authored by Aurel's avatar Aurel

- remove node in DISCARDED_STATE from partition table

- if we have no partition table when client ask for one, request a new
 one to the master node


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@564 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent b831333a
......@@ -49,6 +49,15 @@ class AdminEventHandler(BaseEventHandler):
def handleAskPartitionList(self, conn, packet, min_offset, max_offset, uuid):
logging.info("ask partition list from %s to %s for %s" %(min_offset, max_offset, dump(uuid)))
app = self.app
# check we have one pt otherwise ask it to PMN
if len(app.pt.getNodeList()) == 0:
master_conn = self.app.master_conn
p = protocol.askPartitionTable([x for x in xrange(app.num_partitions)])
master_conn.ask(p)
self.app.pt = None
while self.app.pt is None:
self.app.em.poll(1)
# we have a pt
app.pt.log()
row_list = []
if max_offset == 0:
......@@ -334,10 +343,10 @@ class MonitoringEventHandler(BaseEventHandler):
if uuid != app.uuid:
node.setState(TEMPORARILY_DOWN_STATE)
nm.add(node)
# if state == DISCARDED_STATE:
# pt.dropNode(node)
# else:
pt.setCell(offset, node, state)
if state == DISCARDED_STATE:
pt.removeCell(offset, node)
else:
pt.setCell(offset, node, state)
pt.log()
......
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