-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add paragraph about how to fix ClientStorageError. #139
Conversation
modified: doc/zeo-client-cache.txt
Hm, actually I have no clue why the build breaks, when I just add a paragraph to the documentation section.
I guess I need a helping hand. |
Unfortunately there are a few tests that can be a bit flaky. Often a re-run will fix them. I've kicked off the broken builds again, let's see if that does it. |
Thanks a ton @jamadden !! |
@@ -46,3 +46,7 @@ ZEO Client Cache | |||
|
|||
For example, the cache file for client '8881' and storage 'spam' is named | |||
"8881-spam.zec". | |||
|
|||
If you ever see an error message like "ClientStorageError: Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual underlying error is something like "AssertionError: Server behind client..."; "Client has seen newer transactions than server" is what is logged (which may or may not go somewhere useful).
Perhaps instead of (just?) putting this in the documentation, the actual error and/or log message should be modified to mention removing the cache? Something like "AssertionError: Client cache is out of sync with the server (server behind client: ...). Verify that this is expected and then remove the cache file at %s before restarting." % (self.cache,)"
The ClientCache
object would need to grow a useful __str__
and/or __repr__
to make this work (without poking into its internals).
Come to that, I'm not sure if those are always the right recovery steps..why would this have happened? Wouldn't it mean transactions were removed from the server? Perhaps the server was restored from an older backup? In that case, maybe the client cache is actually a way to recover data, and deleting it prematurely would be a bad thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamadden Thank you very much for taking your time.
I experienced this error today when I pulled a production db into my local dev environment. The only hint on how to fix this problem (without looking in the source code), was in the Plone 3 documentation:
https://docs.plone.org/3/en/manage/troubleshooting/transactions.html#zeostorage-client-has-seen-newer-transactions-than-server
I thought it would be a good idea to document this in the ZEO docs, but obviously there is a better way.
You are absolutely right - it would be far better to improve the error message over putting this in the documentation.
At the moment - besides my day job - I got some open issues/pull requests already for Zope (+ecosystem) and thus no time to "quickly" implement your solution.
Also, from a quick glance tox is not setup to run coverage, and from looking at the code and the tests it seems the branch ("Cache newer than server") is untested.
Lines 488 to 493 in bd7cd06
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) |
At the end of the branch, there is an AssertionError - no resolution like invalidateCache or invalidateTransaction. Maybe that is on purpose, as you mentioned, it may be not always the best idea to delete the client cache, and maybe especially not automatically.
tl/dr
Obviously, this pull request should be closed.
As you proposed an imho very good solution, would you mind opening an issue or should I do it?
Yes, this pull request should be closed. Just removing the cache file may paper over a deeper issue. |
Gonna close this pr in favor of #142 - thanks for your input! |
modified: doc/zeo-client-cache.txt