Commit aba0d60f authored by Aurel's avatar Aurel

if a SN is declaring itself up to date for a partition it has not been

assigned to, tell it that it is in error


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@470 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1db68f81
......@@ -21,7 +21,7 @@ from copy import copy
from neo.protocol import MASTER_NODE_TYPE, CLIENT_NODE_TYPE, \
RUNNING_STATE, BROKEN_STATE, TEMPORARILY_DOWN_STATE, DOWN_STATE, \
UP_TO_DATE_STATE, FEEDING_STATE, DISCARDED_STATE, \
STORAGE_NODE_TYPE, ADMIN_NODE_TYPE
STORAGE_NODE_TYPE, ADMIN_NODE_TYPE, OUT_OF_DATE_STATE
from neo.master.handler import MasterEventHandler
from neo.protocol import Packet, INVALID_UUID
from neo.exception import OperationFailure, ElectionFailure
......@@ -661,6 +661,19 @@ class ServiceEventHandler(MasterEventHandler):
continue
offset = cell[0]
logging.debug("node %s is up for offset %s" %(dump(node.getUUID()), offset))
# check the storage said it is up to date for a partition it was assigne to
for xcell in app.pt.getCellList(offset):
if xcell.getNode().getUUID() == node.getUUID() and \
xcell.getState() not in (OUT_OF_DATE_STATE, UP_TO_DATE_STATE):
msg = "node %s telling that it is UP TO DATE for offset \
%s but where %s for that offset" %(dump(node.getUUID()), offset, xcell.getState())
logging.warning(msg)
self.handleError(conn, packet, INTERNAL_ERROR_CODE, msg)
return
app.pt.setCell(offset, node, UP_TO_DATE_STATE)
new_cell_list.append(cell)
......
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