Commit 33fab6e3 authored by Levin Zimmermann's avatar Levin Zimmermann

Revert "proto: Switch 'compress' type on the wire from Optional[int] to bool"

This reverts commit 93f25df5.
parent 93f25df5
...@@ -506,7 +506,7 @@ class Application(ThreadedApplication): ...@@ -506,7 +506,7 @@ class Application(ThreadedApplication):
checksum = makeChecksum(compressed_data) checksum = makeChecksum(compressed_data)
txn_context.data_size += size txn_context.data_size += size
# Store object in tmp cache # Store object in tmp cache
packet = Packets.AskStoreObject(oid, serial, bool(compression), packet = Packets.AskStoreObject(oid, serial, compression,
checksum, compressed_data, data_serial, ttid) checksum, compressed_data, data_serial, ttid)
txn_context.data_dict[oid] = data, serial, txn_context.write( txn_context.data_dict[oid] = data, serial, txn_context.write(
self, packet, oid, oid=oid, serial=serial) self, packet, oid, oid=oid, serial=serial)
......
...@@ -619,7 +619,7 @@ class ImporterDatabaseManager(DatabaseManager): ...@@ -619,7 +619,7 @@ class ImporterDatabaseManager(DatabaseManager):
if next_serial: if next_serial:
next_serial = p64(next_serial) next_serial = p64(next_serial)
return (serial, next_serial, return (serial, next_serial,
False, checksum, value, zodb.getDataTid(z_oid, u_tid)) 0, checksum, value, zodb.getDataTid(z_oid, u_tid))
def getTransaction(self, tid, all=False): def getTransaction(self, tid, all=False):
u64 = util.u64 u64 = util.u64
......
...@@ -474,7 +474,7 @@ class DatabaseManager(object): ...@@ -474,7 +474,7 @@ class DatabaseManager(object):
6-tuple: Record content. 6-tuple: Record content.
- record serial (packed) - record serial (packed)
- serial or next record modifying object (packed, None) - serial or next record modifying object (packed, None)
- compression (boolean) - compression (boolean-ish, None)
- checksum (binary string, None) - checksum (binary string, None)
- data (binary string, None) - data (binary string, None)
- data_serial (packed, None) - data_serial (packed, None)
...@@ -489,7 +489,7 @@ class DatabaseManager(object): ...@@ -489,7 +489,7 @@ class DatabaseManager(object):
return (tid or before_tid) and self.getLastObjectTID(oid) and False return (tid or before_tid) and self.getLastObjectTID(oid) and False
return (util.p64(serial), return (util.p64(serial),
None if next_serial is None else util.p64(next_serial), None if next_serial is None else util.p64(next_serial),
bool(compression), checksum, data, compression, checksum, data,
None if data_serial is None else util.p64(data_serial)) None if data_serial is None else util.p64(data_serial))
@fallback @fallback
...@@ -511,7 +511,7 @@ class DatabaseManager(object): ...@@ -511,7 +511,7 @@ class DatabaseManager(object):
r = self._fetchObject(u64(oid), u64(tid)) r = self._fetchObject(u64(oid), u64(tid))
if r: if r:
serial, compression, checksum, data, data_serial = r serial, compression, checksum, data, data_serial = r
return (util.p64(serial), bool(compression), checksum, data, return (util.p64(serial), compression, checksum, data,
None if data_serial is None else util.p64(data_serial)) None if data_serial is None else util.p64(data_serial))
@requires(_getPartitionTable) @requires(_getPartitionTable)
......
...@@ -114,6 +114,8 @@ class ClientOperationHandler(BaseHandler): ...@@ -114,6 +114,8 @@ class ClientOperationHandler(BaseHandler):
def askStoreObject(self, conn, oid, serial, def askStoreObject(self, conn, oid, serial,
compression, checksum, data, data_serial, ttid): compression, checksum, data, data_serial, ttid):
if 1 < compression:
raise ProtocolError('invalid compression value')
# register the transaction # register the transaction
self.app.tm.register(conn, ttid) self.app.tm.register(conn, ttid)
if data or checksum != ZERO_HASH: if data or checksum != ZERO_HASH:
......
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