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 26A5618951 for ; Fri, 22 May 2015 11:19:18 +0000 (UTC) Received: (qmail 72488 invoked by uid 500); 22 May 2015 11:19:17 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 72450 invoked by uid 500); 22 May 2015 11:19:17 -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 72437 invoked by uid 99); 22 May 2015 11:19:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2015 11:19:17 +0000 Date: Fri, 22 May 2015 11:19:17 +0000 (UTC) From: "Paul Praet (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-9449) Running ALTER TABLE cql statement asynchronously results in failure 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-9449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14555793#comment-14555793 ] Paul Praet edited comment on CASSANDRA-9449 at 5/22/15 11:18 AM: ----------------------------------------------------------------- 1) Yes: {code} cqlsh> DESCRIBE TABLE wifidoctor.device; CREATE TABLE wifidoctor.device ( columna text, columnb text, columnc timestamp, columnd text, columne text, columnf text, columng text, columnh text, PRIMARY KEY ((columna, columnb)) ) WITH bloom_filter_fp_chance = 0.01 AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' AND comment = '' AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32'} AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99.0PERCENTILE'; cqlsh> INSERT INTO wifidoctor.device (columnA, columnB, columnC,columnD,columnE,columnF,columnG,columnH) VALUES ('a','','2015-01-01','','','','',''); InvalidRequest: code=2200 [Invalid query] message="Unknown identifier columne" {code} 2) yes, it does. After the restart, the INSERT query works. was (Author: praetp): 1) Yes: {code} CREATE TABLE wifidoctor.device ( columna text, columnb text, columnc timestamp, columnd text, columne text, columnf text, columng text, columnh text, PRIMARY KEY ((columna, columnb)) ) WITH bloom_filter_fp_chance = 0.01 AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' AND comment = '' AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32'} AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99.0PERCENTILE'; cqlsh> INSERT INTO wifidoctor.device (columnA, columnB, columnC,columnD,columnE,columnF,columnG,columnH) VALUES ('a','','2015-01-01','','','','',''); InvalidRequest: code=2200 [Invalid query] message="Unknown identifier columne" {code} 2) yes, it does. After the restart, the INSERT query works. > Running ALTER TABLE cql statement asynchronously results in failure > ------------------------------------------------------------------- > > Key: CASSANDRA-9449 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9449 > Project: Cassandra > Issue Type: Bug > Environment: Singe cluster environment > Reporter: Paul Praet > > When running 'ALTER TABLE' cql statements asynchronously, we notice that often certain columns are missing, causing subsequent queries to fail. > The code snippet below can be used to reproduce the problem. > cassandra is a com.datastax.driver.core.Session reference. > We construct the table synchronously and then alter it (adding five columns) with the cassandra async API. We synchronize to ensure the table is properly altered before continuing. Preparing the statement at the bottom of the code snippet often fails: > {noformat} com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier columnf {noformat} > {code} > @Test > public void testCassandraAsyncAlterTable() throws Exception { > ResultSet rs = cassandra.execute("CREATE TABLE device ( columnA text, columnB text, columnC timestamp, PRIMARY KEY ((columnA, columnB)));"); > List futures = new ArrayList<>(); > futures.add(cassandra.executeAsync("ALTER TABLE device ADD columnD text;")); > futures.add(cassandra.executeAsync("ALTER TABLE device ADD columnE text;")); > futures.add(cassandra.executeAsync("ALTER TABLE device ADD columnF text;")); > futures.add(cassandra.executeAsync("ALTER TABLE device ADD columnG text;")); > futures.add(cassandra.executeAsync("ALTER TABLE device ADD columnH text;")); > for(ResultSetFuture resultfuture : futures){ resultfuture.get(); } > > /* discard the result; only interested to see if it works or not */ > cassandra.prepare("INSERT INTO device (columnA, columnB, columnC,columnD,columnE,columnF,columnG,columnH) VALUES (?,?,?,?,?,?,?,?);"); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)