Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log and exception message #142

Closed
jugmac00 opened this issue Apr 25, 2019 · 1 comment · Fixed by #173
Closed

Improve log and exception message #142

jugmac00 opened this issue Apr 25, 2019 · 1 comment · Fixed by #173
Assignees

Comments

@jugmac00
Copy link
Member

jugmac00 commented Apr 25, 2019

When there is a newer transaction id on the client than on the server - for instance after a backup has been restored - following message gets logged:
"ClientStorageError: Client has seen newer transactions than server!"

The admin is left with this message and probably does not know how to recover a working state - as Zope is no longer usable.

What worked for me - and maybe is not always the best solution was to remove the zec file, cf
https://docs.plone.org/3/en/manage/troubleshooting/transactions.html#zeostorage-client-has-seen-newer-transactions-than-server

There may be other reasons for this error and maybe other recovery steps make more sense then.

From a quick glance tox is not setup to run coverage (see #123 ), and from looking at the code and the tests it seems the branch ("Cache newer than server") is untested.

Update
The branch gets covered by

def test_bad_server_tid(self):

Was hard to spot, as the test does neither check for the AssertionError nor for the log message.

elif cache_tid > server_tid:
self.verify_result = "Cache newer than server"
logger.critical(
'Client has seen newer transactions than server!')
raise AssertionError("Server behind client, %r < %r, %s",
server_tid, cache_tid, protocol)

Also, the tests for ZEO seems to be quite flaky, cf #140

@jamadden made some good suggestions how to proceed:
#139 (comment)

[Removed wrong assumption about assert / AssertionError]

@jamadden
Copy link
Member

I do not know what to think about the AssertionError - as there is no guarantee that it get raised,

It will always be raised. Only the assert statement can be disabled by -O; a raise is always executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants