From commits-return-210197-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Fri May 11 16:48:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3418C1807AA for ; Fri, 11 May 2018 16:48:04 +0200 (CEST) Received: (qmail 24952 invoked by uid 500); 11 May 2018 14:48:03 -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 24764 invoked by uid 99); 11 May 2018 14:48:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2018 14:48:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A66A8C0033 for ; Fri, 11 May 2018 14:48:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id VfU9pTTOjZfy for ; Fri, 11 May 2018 14:48:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E98C85FAD2 for ; Fri, 11 May 2018 14:48:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 765D6E0F39 for ; Fri, 11 May 2018 14:48:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2B31121546 for ; Fri, 11 May 2018 14:48:00 +0000 (UTC) Date: Fri, 11 May 2018 14:48:00 +0000 (UTC) From: "Jeremy Hanna (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-5925) Race condition in update lightweight transaction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremy Hanna updated CASSANDRA-5925: ------------------------------------ Labels: LWT (was: ) > Race condition in update lightweight transaction > ------------------------------------------------ > > Key: CASSANDRA-5925 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5925 > Project: Cassandra > Issue Type: Bug > Environment: 3 node Cassandra 2.0.0-rc2 cluster. Java driver 1.0.2. > Reporter: Phil Persad > Assignee: Sylvain Lebresne > Priority: Major > Labels: LWT > Fix For: 2.0.0 > > Attachments: 5925.txt, TokenConsumptionTest.java > > > I'm building some tests for a Cassandra PoC. One scenario I need to test is consumption of 1 time tokens. These tokens must be consumed exactly once. The cluster involved is a 3 node cluster. All queries are run with ConsistencyLevel.QUORUM. I'm using the following queries: > CREATE KEYSPACE IF NOT EXISTS test WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 }; > CREATE TABLE IF NOT EXISTS tkns (tkn blob, consumed boolean, PRIMARY KEY (tkn)); > INSERT INTO tkns (tkn, consumed) VALUES (?,FALSE) USING TTL 30; > UPDATE tkns USING TTL 1 SET consumed = TRUE WHERE tkn = ? IF consumed = FALSE; > I use the '[applied]' column in the result set of the update statement to determine whether the token has been successfully consumed or if the token is being replayed. > My test involves concurrently executing many sets of 1 insert and 2 update statements (using Session#execute on BoundStatemnts) then checking to make sure that only one of the updates was applied. > When I run this test with relatively few iterations (~100) my results are what I expect (exactly 1 update succeeds). At ~1000 iterations, I start seeing both updates reporting success in 1-2% of cases. While my test is running, I see corresponding error entries in the Cassandra log: > ERROR 15:34:53,583 Exception in thread Thread[MutationStage:522,5,main] > java.lang.NullPointerException > ERROR 15:34:53,584 Exception in thread Thread[MutationStage:474,5,main] > java.lang.NullPointerException > ERROR 15:34:53,584 Exception in thread Thread[MutationStage:536,5,main] > java.lang.NullPointerException > ERROR 15:34:53,729 Exception in thread Thread[MutationStage:480,5,main] > java.lang.NullPointerException > ERROR 15:34:53,729 Exception in thread Thread[MutationStage:534,5,main] > java.lang.NullPointerException > Thanks. > Update: > I'm not sure what's going on with the logging the the dev release. I grabbed the rc2 source and built that. The resultant log is a bit more informative: > ERROR 11:53:38,967 Exception in thread Thread[MutationStage:114,5,main] > java.lang.NullPointerException > at org.apache.cassandra.serializers.UUIDSerializer.deserialize(UUIDSerializer.java:32) > at org.apache.cassandra.serializers.UUIDSerializer.deserialize(UUIDSerializer.java:26) > at org.apache.cassandra.db.marshal.AbstractType.compose(AbstractType.java:142) > at org.apache.cassandra.cql3.UntypedResultSet$Row.getUUID(UntypedResultSet.java:131) > at org.apache.cassandra.db.SystemKeyspace.loadPaxosState(SystemKeyspace.java:785) > at org.apache.cassandra.service.paxos.PaxosState.commit(PaxosState.java:118) > at org.apache.cassandra.service.paxos.CommitVerbHandler.doVerb(CommitVerbHandler.java:34) > at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:722) -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org