[MXS-1474] Cache module should be ACID compliant Created: 2017-10-16 Updated: 2017-12-01 Resolved: 2017-10-31 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | cache |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.1 |
| Type: | New Feature | Priority: | Blocker |
| Reporter: | Michaël de groot | Assignee: | Johan Wikman |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 2017-44 |
| Description |
|
Hi, From our lunch talk I got the impression that the cache module is not ACID compliant: Please change this so read/write transactional reads do not return cached results. Thanks, |
| Comments |
| Comment by Johan Wikman [ 2017-10-16 ] | |
|
I'm thinking of adding the following kind of configuration parameter. isolation
Default is read_committed. How does that sound? | |
| Comment by Johan Wikman [ 2017-10-23 ] | |
|
This issue is in fact not limited to read/write transactions, but applies to read-only as well. Suppose a transaction is started and something is selected and suppose the result was found from the cache. Then suppose the same thing is selected again, but this time the ttl has been reached and the data is fetched from the server. There is no guarantee that the result will be identical. Thus, if read_committed behaviour is required, then caching cannot be used during transactions. So, I think I will still introduce that isolation configuration parameter and if its value is set to repeatable_read then no data will be returned from the cache during transactions. It will be populated though, so selects done with autocommit being enabled will be served from the cache. | |
| Comment by Johan Wikman [ 2017-10-31 ] | |
|
There is now a new configuration parameter cache_in_transactions that can take the following values:
With read_only_transactions, explicitly read only transactions behave as if the isolation level of the server were read committed. With all_transactions all transactions behave as if the isolation level of the server were read committed. |