[MDEV-3997] Querying a Cassandra table on a server with query cache enabled is likely to cause problems Created: 2013-01-04  Updated: 2014-10-01  Resolved: 2013-02-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Cassandra
Affects Version/s: 10.0.1
Fix Version/s: 10.0.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: cassandra

Issue Links:
Relates
relates to MDEV-431 Cassandra storage engine Closed
relates to MDEV-6783 OQGRAPH - allow dependant table with ... Open

 Description   

Since Cassandra is by nature a shared storage which can be accessed (and modified) through different Cassandra SE tables, doing it from a server where query cache is enabled is likely to produce wrong results. Of course, the workaround is to use SQL_NO_CACHE in a query, but it's error-prone. Besides, generally a user would have no way to know whether the storage gets updated or not, so they'll have to set SQL_NO_CACHE every time; and if so, it makes sense to either force disabling query cache for Cassandra tables, or to provide a system-wide parameter for doing so.

Example of the problem:

cqlsh:manual_test> create columnfamily cf1 ( rowkey int primary key, a int );

drop table if exists t1, t2;
create table t1 (rowkey int primary key, a int) engine=cassandra keyspace='manual_test' column_family='cf1';
create table t2 like t1;
 
set global query_cache_size=1024*1024;
 
select * from t1;
# Empty set (0.01 sec)
 
insert into t2 values (1,1);
 
select * from t1;
# Empty set (0.00 sec)
 
select sql_no_cache * from t1;
# +--------+------+
# | rowkey | a    |
# +--------+------+
# |      1 |    1 |
# +--------+------+
# 1 row in set (0.01 sec)
 

revision-id: psergey@askmonty.org-20121224043622-xn8g8y3vhtu1lb3w
revno: 3459
branch: 10.0-base-cassandra



 Comments   
Comment by Sergei Petrunia [ 2013-01-10 ]

Discussed with Sanja: it seems, query cache should be disabled for cassandra tables. This can be achieved like this:

ha_cassandra::table_cache_type()

{ return HA_CACHE_TBL_NOCACHE; }
Comment by Sergei Petrunia [ 2013-02-04 ]

Disabled query cache for cassandra tables.

Generated at Thu Feb 08 06:52:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.