Cassandra
  1. Cassandra
  2. CASSANDRA-2990

We should refuse query for counters at CL.ANY

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Fix Version/s: 0.8.4
    • Component/s: None
    • Labels:

      Description

      We currently do not reject writes for counters at CL.ANY, even though this is not supported (and rightly so).

      1. 2990.patch
        4 kB
        Sylvain Lebresne

        Activity

        Hide
        Jonathan Ellis added a comment -

        A few days ago, you said, "A counter mutation only live enough so that it is applied to the first replica. Once this is done, a row mutation is generated for the other replica. That second mutation can be hinted. But that is a row mutation, so there should be no special casing at all for that."

        Why can't we hint the first replica?

        Show
        Jonathan Ellis added a comment - A few days ago, you said, "A counter mutation only live enough so that it is applied to the first replica. Once this is done, a row mutation is generated for the other replica. That second mutation can be hinted. But that is a row mutation, so there should be no special casing at all for that." Why can't we hint the first replica?
        Hide
        Sylvain Lebresne added a comment -

        Why can't we hint the first replica?

        Well, actually I think we could. Or at least if we cannot I forgot why. We would need to be sure we never replay an hint twice though, which I'm not sure is a guarantee right now. Also, we can only make this if what we store as a hint is the serialized mutation (in this case, the serialized CounterMutation): we can't apply the CounterMutation on a non-replica (partly because that would potentially increase the counter context too much, partly because counter remove suck, which would probably be a problem at some point).

        So it should be doable, but it's a bit of work.

        Show
        Sylvain Lebresne added a comment - Why can't we hint the first replica? Well, actually I think we could. Or at least if we cannot I forgot why. We would need to be sure we never replay an hint twice though, which I'm not sure is a guarantee right now. Also, we can only make this if what we store as a hint is the serialized mutation (in this case, the serialized CounterMutation): we can't apply the CounterMutation on a non-replica (partly because that would potentially increase the counter context too much, partly because counter remove suck, which would probably be a problem at some point). So it should be doable, but it's a bit of work.
        Hide
        Jonathan Ellis added a comment -

        Okay, +1 on making the validation match what is actually currently supported (no ANY for counters), although I'd change "not supported" to "not yet supported."

        We can deal w/ adding ANY support if and when someone actually needs it.

        Show
        Jonathan Ellis added a comment - Okay, +1 on making the validation match what is actually currently supported (no ANY for counters), although I'd change "not supported" to "not yet supported." We can deal w/ adding ANY support if and when someone actually needs it.
        Hide
        Sylvain Lebresne added a comment -

        Committed with message tweak

        Show
        Sylvain Lebresne added a comment - Committed with message tweak
        Hide
        Hudson added a comment -

        Integrated in Cassandra-0.8 #265 (See https://builds.apache.org/job/Cassandra-0.8/265/)
        Refuse counter write at CL.ANY
        patch by slebresne; reviewed by jbellis for CASSANDRA-2990

        slebresne : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1155548
        Files :

        • /cassandra/branches/cassandra-0.8/test/system/test_cql.py
        • /cassandra/branches/cassandra-0.8/CHANGES.txt
        • /cassandra/branches/cassandra-0.8/test/system/test_thrift_server.py
        • /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/ThriftValidation.java
        • /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/UpdateStatement.java
        Show
        Hudson added a comment - Integrated in Cassandra-0.8 #265 (See https://builds.apache.org/job/Cassandra-0.8/265/ ) Refuse counter write at CL.ANY patch by slebresne; reviewed by jbellis for CASSANDRA-2990 slebresne : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1155548 Files : /cassandra/branches/cassandra-0.8/test/system/test_cql.py /cassandra/branches/cassandra-0.8/CHANGES.txt /cassandra/branches/cassandra-0.8/test/system/test_thrift_server.py /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/ThriftValidation.java /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/UpdateStatement.java

          People

          • Assignee:
            Sylvain Lebresne
            Reporter:
            Sylvain Lebresne
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development