Commit b9b6704f authored by Aurel's avatar Aurel

fix parameter of handleAskStoreObject


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@111 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5b1b9b66
...@@ -208,7 +208,7 @@ class EventHandler(object): ...@@ -208,7 +208,7 @@ class EventHandler(object):
def handleUnlockInformation(self, conn, packet, tid): def handleUnlockInformation(self, conn, packet, tid):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
def handleAskStoreObject(self, conn, packet, msg_id, oid, serial, def handleAskStoreObject(self, conn, packet, oid, serial,
compression, data, checksum, tid): compression, data, checksum, tid):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
......
...@@ -202,7 +202,7 @@ class StorageEventHandler(EventHandler): ...@@ -202,7 +202,7 @@ class StorageEventHandler(EventHandler):
ext, oid_list): ext, oid_list):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
def handleAskStoreObject(self, conn, packet, msg_id, oid, serial, def handleAskStoreObject(self, conn, packet, oid, serial,
compression, data, checksum, tid): compression, data, checksum, tid):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
...@@ -136,7 +136,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -136,7 +136,7 @@ class OperationEventHandler(StorageEventHandler):
# If I do not know such a node, and it is not even a master # If I do not know such a node, and it is not even a master
# node, simply reject it. # node, simply reject it.
logging.error('reject an unknown node') logging.error('reject an unknown node')
conn.addPacket(Packet().notReady(packet.getId(), conn.addPacket(Packet().notReady(packet.getId(),
'unknown node')) 'unknown node'))
conn.abort() conn.abort()
return return
...@@ -235,7 +235,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -235,7 +235,7 @@ class OperationEventHandler(StorageEventHandler):
if t is None: if t is None:
p.tidNotFound(packet.getId(), '%s does not exist' % dump(tid)) p.tidNotFound(packet.getId(), '%s does not exist' % dump(tid))
else: else:
p.answerTransactionInformation(packet.getId(), tid, p.answerTransactionInformation(packet.getId(), tid,
t[1], t[2], t[0]) t[1], t[2], t[0])
conn.addPacket(p) conn.addPacket(p)
...@@ -304,7 +304,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -304,7 +304,7 @@ class OperationEventHandler(StorageEventHandler):
serial, next_serial, compression, checksum, data = o serial, next_serial, compression, checksum, data = o
if next_serial is None: if next_serial is None:
next_serial = INVALID_SERIAL next_serial = INVALID_SERIAL
p.answerObject(packet.getId(), oid, serial, next_serial, p.answerObject(packet.getId(), oid, serial, next_serial,
compression, checksum, data) compression, checksum, data)
else: else:
p.oidNotFound(packet.getId(), '%s does not exist' % dump(oid)) p.oidNotFound(packet.getId(), '%s does not exist' % dump(oid))
...@@ -314,7 +314,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -314,7 +314,7 @@ class OperationEventHandler(StorageEventHandler):
# This method is complicated, because I must return TIDs only # This method is complicated, because I must return TIDs only
# about usable partitions assigned to me. # about usable partitions assigned to me.
if first >= last: if first >= last:
conn.addPacket(Packet().protocolError(packet.getId(), conn.addPacket(Packet().protocolError(packet.getId(),
'invalid offsets')) 'invalid offsets'))
return return
...@@ -329,14 +329,14 @@ class OperationEventHandler(StorageEventHandler): ...@@ -329,14 +329,14 @@ class OperationEventHandler(StorageEventHandler):
partition_list.append(offset) partition_list.append(offset)
break break
tid_list = app.dm.getTIDList(first, last - first, tid_list = app.dm.getTIDList(first, last - first,
app.num_partitions, partition_list) app.num_partitions, partition_list)
conn.addPacket(Packet().answerTIDs(packet.getId(), tid_list)) conn.addPacket(Packet().answerTIDs(packet.getId(), tid_list))
def handleAskObjectHistory(self, conn, packet, oid, length): def handleAskObjectHistory(self, conn, packet, oid, length):
app = self.app app = self.app
history_list = app.dm.getObjectHistory(oid, length) history_list = app.dm.getObjectHistory(oid, length)
conn.addPacket(Packet().answerObjectHistory(packet.getId(), conn.addPacket(Packet().answerObjectHistory(packet.getId(),
history_list)) history_list))
def handleAskStoreTransaction(self, conn, packet, tid, user, desc, def handleAskStoreTransaction(self, conn, packet, tid, user, desc,
...@@ -354,7 +354,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -354,7 +354,7 @@ class OperationEventHandler(StorageEventHandler):
t.addTransaction(oid_list, user, desc, ext) t.addTransaction(oid_list, user, desc, ext)
conn.addPacket(Packet().answerStoreTransaction(packet.getId(), tid)) conn.addPacket(Packet().answerStoreTransaction(packet.getId(), tid))
def handleAskStoreObject(self, conn, packet, msg_id, oid, serial, def handleAskStoreObject(self, conn, packet, oid, serial,
compression, data, checksum, tid): compression, data, checksum, tid):
uuid = conn.getUUID() uuid = conn.getUUID()
if uuid is None: if uuid is None:
...@@ -367,8 +367,8 @@ class OperationEventHandler(StorageEventHandler): ...@@ -367,8 +367,8 @@ class OperationEventHandler(StorageEventHandler):
if locking_tid is not None: if locking_tid is not None:
if locking_tid < tid: if locking_tid < tid:
# Delay the response. # Delay the response.
app.queueEvent(self.handleAskStoreObject, conn, packet, app.queueEvent(self.handleAskStoreObject, conn, packet,
msg_id, oid, serial, compression, data, packet.getId(), oid, serial, compression, data,
checksum, tid) checksum, tid)
else: else:
# If a newer transaction already locks this object, # If a newer transaction already locks this object,
...@@ -389,7 +389,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -389,7 +389,7 @@ class OperationEventHandler(StorageEventHandler):
# Now store the object. # Now store the object.
t = app.transaction_dict.setdefault(tid, TransactionInformation(uuid)) t = app.transaction_dict.setdefault(tid, TransactionInformation(uuid))
t.addObject(oid, compression, checksum, data) t.addObject(oid, compression, checksum, data)
conn.addPacket(Packet().answerStoreObject(packet.getId(), 0, conn.addPacket(Packet().answerStoreObject(packet.getId(), 0,
oid, serial)) oid, serial))
app.store_lock_dict[oid] = tid app.store_lock_dict[oid] = tid
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