Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C2A418223 for ; Fri, 15 Jan 2016 23:22:40 +0000 (UTC) Received: (qmail 572 invoked by uid 500); 15 Jan 2016 23:22:40 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 538 invoked by uid 500); 15 Jan 2016 23:22:40 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 501 invoked by uid 99); 15 Jan 2016 23:22:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2016 23:22:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D5DC42C14F7 for ; Fri, 15 Jan 2016 23:22:39 +0000 (UTC) Date: Fri, 15 Jan 2016 23:22:39 +0000 (UTC) From: "DOAN DuyHai (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CASSANDRA-11023) Restrict mutation consistency level to QUORUM+ for LWT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 DOAN DuyHai created CASSANDRA-11023: --------------------------------------- Summary: Restrict mutation consistency level to QUORUM+ for LW= T Key: CASSANDRA-11023 URL: https://issues.apache.org/jira/browse/CASSANDRA-11023 Project: Cassandra Issue Type: Bug Components: Coordination Reporter: DOAN DuyHai 5 nodes cluster, RF =3D 3 =E2=86=92 LWT consistency =3D SERIAL =E2=86=92 Mutation consistency =3D ONE 1. Client 1 sends a INSERT INTO test (partition_key, value) VALUES(*1*, *= =E2=80=98ONE=E2=80=99*) IF NOT EXISTS 2. Paxos round successfully gets ballot1 3. The IF NOT EXISTS condition is validated (reading with QUORUM on all rep= licas) 4. Paxos round validated 5. Mutation applied using consistency level ONE. Mutation pushed to replica= s A, B and C=20 6. Replica A sends back acks. *Replicas B and C did not receive the mutatio= n* (temporary network issue). The LWT operation is successful since we do n= ot wait for acks from B and C This LWT is considered successful 7. Client 2 starts a LWT : INSERT INTO test (partition_key, value) VALUES(= *1*, *=E2=80=98TWO=E2=80=99*) IF NOT EXISTS 8. Paxos round successfully gets ballot2 (ballot2 > ballot1) 9. The IF NOT EXISTS condition is validated (*reading with QUORUM and repli= ca B and C reply that partition 1 does not exist*) 10. The semantics of LWT is violated because indeed the partition already e= xists (because first LWT succeeded) with value =3D =E2=80=98ONE=E2=80=99 I'm not saying that there is a bug in our LWT implementation, it works as = designed. The problem here is that I can't see any legit/sensible use-case = for LWT with mutation CL=3DONE since it opens the door for edge cases like = the one described above and it defeats the purpose of Compare And Swap. Fur= thermore it can confuse a lot of people not familiar of how LWT is implemen= ted internally. Ideally, we should remove/ignore mutation CL for LWT and always use QUORUM= /LOCAL_QUORUM. But for the sake of not breaking the existing API, it would = be sufficient enough to validate and reject mutation CL < QUORUM. -- This message was sent by Atlassian JIRA (v6.3.4#6332)