From af766d5bb5d37bd6b8a8fee31ad8d90f226c7fea Mon Sep 17 00:00:00 2001 From: Jim Fulton Date: Thu, 4 Aug 2016 09:55:23 -0400 Subject: [PATCH] - The ZEO server register method now returns the storage last transaction, allowing the client to avoid an extra round trip during cache verification. --- CHANGES.rst | 4 ++++ src/ZEO/StorageServer.py | 2 ++ src/ZEO/tests/testZEO.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8ee13bcba..62abb25dd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,10 @@ Changelog ========= +- The ZEO server register method now returns the storage last + transaction, allowing the client to avoid an extra round trip during + cache verification. + - Fixed bugs in using the ZEO 5 client with ZEO 4 servers. 5.0.0a2 (2016-07-30) diff --git a/src/ZEO/StorageServer.py b/src/ZEO/StorageServer.py index b07a228cb..23f5a71d7 100644 --- a/src/ZEO/StorageServer.py +++ b/src/ZEO/StorageServer.py @@ -222,6 +222,8 @@ def register(self, storage_id, read_only): self.stats = self.server.register_connection(storage_id, self) self.lock_manager = self.server.lock_managers[storage_id] + return self.lastTransaction() + def get_info(self): storage = self.storage diff --git a/src/ZEO/tests/testZEO.py b/src/ZEO/tests/testZEO.py index a4e96b6b0..e5883a831 100644 --- a/src/ZEO/tests/testZEO.py +++ b/src/ZEO/tests/testZEO.py @@ -831,7 +831,8 @@ def getInvalidationsAfterServerRestart(): >>> sv = StorageServer(None, dict(fs=fs)) >>> s = ZEOStorage(sv, sv.read_only) >>> s.notify_connected(FauxConn()) - >>> s.register('fs', False) + >>> s.register('fs', False) == fs.lastTransaction() + True If we ask for the last transaction, we should get the last transaction we saved: