-
Notifications
You must be signed in to change notification settings - Fork 93
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
pgpool query cache #68
Comments
In what case the cache invalidation failed? You mean something like this?
|
The time for pgpool to invalidate cache is after the transaction is committed. However, if some errors occur during invalidation, resulting in invalidation failure, the next query will return the old results. |
What are "some errors"? Besides bugs of pgpool I cannot think of errors during the invalidation. Or you actually have found any bugs? |
Emit log and give up invalidation. See the source code for more details. |
Although the emit fails to invalidate the log, the next query will still be able to read the old error result from the cache, right? |
That depends on what kind of error happened with memcached. If that's a network error, subsequent fetching attempt likely fails too. In that case pgpool disables use of query cache.I hardly think the case only deleting item on memcached fails but fetcing data from memcached suceeds. |
Can inconsistency be avoided if invalidation is performed before transaction commit? |
Assuming you are talking about an explicit transaction case, no it causes inconsistency if the transaction is rolled back, rather than committed. Until commit or rollback (abort) command is arrived from the client, there's no way to judge invalidation should be done or not. |
For exaple: T2: |
Pgpool Invalidates the cache after the completion of COMMIT command in PostgreSQL. i.e.
So it's too late for Pgpool to rollback the transaction at 3. |
Considering adding query cache to postgresql, can the invalidate operation be performed before the transaction is committed? |
I haven't tried it before but it seems there's no reason that is impossible. |
Thanks for your time. |
I have a question, that fetching query result from memcache may get old value?
For example:
In pgpool code Implementation: DML/DDL invalidate cache in ReadyForQuery function but the DML/DDL committed , so if failed to invalidate the cache , nexted-query will get a old wrong result.
hope reply, thank you!
The text was updated successfully, but these errors were encountered: