Skip to content

Commit

Permalink
improve log message when client cache is out of sync with server
Browse files Browse the repository at this point in the history
This fixes #142
  • Loading branch information
jugmac00 committed Apr 24, 2021
1 parent 10778e1 commit d5f6383
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Changelog
- Fix data corruption due to race between load and external invalidations.
See `issue 155 <https://github.com/zopefoundation/ZEO/issues/155>`_.

- Improve log message when client cache is out of sync with server.
See `issue 142 <https://github.com/zopefoundation/ZEO/issues/142>`_.

5.2.2 (2020-08-11)
------------------

Expand Down
5 changes: 4 additions & 1 deletion src/ZEO/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,10 @@ def verify(self, server_tid):
elif cache_tid > server_tid:
self.verify_result = "Cache newer than server"
logger.critical(
'Client has seen newer transactions than server!')
'Client cache is out of sync with the server. '
'Verify that this is expected and then remove '
'the cache file (usually a .zec file) '
'before restarting the server.')
raise AssertionError("Server behind client, %r < %r, %s",
server_tid, cache_tid, protocol)
elif cache_tid == server_tid:
Expand Down
2 changes: 1 addition & 1 deletion src/ZEO/tests/testZEO.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ def client_has_newer_data_than_server():
>>> wait_until('got enough errors', lambda:
... len([x for x in handler.records
... if x.levelname == 'CRITICAL' and
... 'Client has seen newer transactions than server!' in x.msg
... 'Client cache is out of sync with the server.' in x.msg
... ]) >= 2)
Note that the errors repeat because the client keeps on trying to connect.
Expand Down

0 comments on commit d5f6383

Please sign in to comment.