Skip to content

Commit

Permalink
- The ZEO server register method now returns the storage last
Browse files Browse the repository at this point in the history
  transaction, allowing the client to avoid an extra round trip during
  cache verification.
  • Loading branch information
Jim Fulton committed Aug 4, 2016
1 parent 765c3b9 commit af766d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions 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)
Expand Down
2 changes: 2 additions & 0 deletions src/ZEO/StorageServer.py
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/ZEO/tests/testZEO.py
Expand Up @@ -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:
Expand Down

0 comments on commit af766d5

Please sign in to comment.