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

How to fix CacheConsistencyError #436

Closed
panjunyong opened this issue Jan 22, 2021 · 6 comments
Closed

How to fix CacheConsistencyError #436

panjunyong opened this issue Jan 22, 2021 · 6 comments

Comments

@panjunyong
Copy link

panjunyong commented Jan 22, 2021

I have used Relstorage for a long time, and it is quite stable.

But today our server raises CacheConsistencyError when any transaction commited.

I am using RelStorage 3.2 with mysql.

CacheConsistencyError: Detected an inconsistency between the RelStorage cache and the database while loading an object using the MVCC index.  Please verify the database is configured for ACID compliance and that all clients are using the same commit lock. Info:
{'actual_expect_delta': 278514579995521996L,
 'actual_tid': '2021-01-21 10:48:55.640673',
 'actual_tid_int': 278514579995521996L,
 'current_tid': 278514774825393783L,
 'cursor': <MySQLdb.cursors.Cursor object at 0x7f5ab6aee110>,
 'expect_tid': '1900-01-01 00:00:00.000000',
 'expect_tid_int': 0,
 'oid_int': 28506858L,
 'pid': 46,
 'thread_ident': <_MainThread(uWSGIWorker1Core0, started 140028186495808)>}

How to fix this problem?

@jamadden
Copy link
Member

You'll want to stop all processes using RelStorage, and then remove any persistent cache files you have. If you're still using memcache, you'll also want to clear that out too. Then you can start the processes back up and things should be fine. If they're not, then there's a fundamental problem in your database (for example, failed replication) that will need to be fixed.

@panjunyong
Copy link
Author

Thanks for your reply.

I am not using the cache-local-dir option, so no persistent cache. And I am not using memcache either.

I tried restart all processes, but it doesn't work. I also checked database tables, and no problem found.

So any other hint?

@panjunyong
Copy link
Author

I just used zodbconvert, and converted to a FileStorage data.fs without any error.

And restart the process and all works fine now.

Now I want to convert it back to relstorage/mysql and have a try.

@panjunyong
Copy link
Author

After convert the data.fs back to relstorage/mysql, all works fine now.

Maybe RelStorage should have a simple recovering script to fix the problem.

@jamadden
Copy link
Member

I'm afraid it's not that simple; there's a real chance you've lost data by ignoring the problem.

@panjunyong
Copy link
Author

But I fixed the problem using zodbconvert without any error or warning.

Does that mean zodbconvert may lost data?

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

No branches or pull requests

2 participants