Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3997

Querying a Cassandra table on a server with query cache enabled is likely to cause problems

    XMLWordPrintable

Details

    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

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.