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 492C318FC9 for ; Mon, 3 Aug 2015 18:58:08 +0000 (UTC) Received: (qmail 21323 invoked by uid 500); 3 Aug 2015 18:58:07 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 21240 invoked by uid 500); 3 Aug 2015 18:58:07 -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 20997 invoked by uid 99); 3 Aug 2015 18:58:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2015 18:58:07 +0000 Date: Mon, 3 Aug 2015 18:58:06 +0000 (UTC) From: "Sam Overton (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CASSANDRA-9966) batched CAS statements are not serializable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Sam Overton created CASSANDRA-9966: -------------------------------------- Summary: batched CAS statements are not serializable Key: CASSANDRA-9966 URL: https://issues.apache.org/jira/browse/CASSANDRA-9966 Project: Cassandra Issue Type: Bug Components: Core Reporter: Sam Overton Priority: Critical It is possible to batch CAS statements such that their outcome is different to the outcome were they executed sequentially outside of a batch. eg. a | b | c a | 1 | 1 BEGIN BATCH UPDATE foo SET b=2 WHERE a='a' iF c=1 UPDATE foo SET c=2 WHERE a='a' IF b=1 APPLY BATCH results in a | b | c a | 2 | 2 If these statements were not batched, the outcome would be UPDATE foo SET b=2 WHERE a='a' iF c=1 a | b | c a | 2 | 1 UPDATE foo SET c=2 WHERE a='a' IF b=1 applied=false (pre-condition b=1 not met) Cassandra already checks for incompatible preconditions within a batch (eg one statement with IF c=1 and another statement with IF c=2). It should also check for mutations to columns in one statement that affect the pre-conditions of another statement, or it should evaluate the statement pre-conditions sequentially after applying the mutations of the previous statement to an in-memory model of the partition. For backwards compatibility this would have to be a new "strict" batch mode, eg. BEGIN STRICT BATCH -- This message was sent by Atlassian JIRA (v6.3.4#6332)