From commits-return-237805-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Mon Sep 7 09:52:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id DA53E180181 for ; Mon, 7 Sep 2020 11:52:02 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id F2FB5121A6F for ; Mon, 7 Sep 2020 09:52:01 +0000 (UTC) Received: (qmail 72095 invoked by uid 500); 7 Sep 2020 09:52:01 -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 72078 invoked by uid 99); 7 Sep 2020 09:52:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2020 09:52:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 951D141976 for ; Mon, 7 Sep 2020 09:52:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 1AC877803F7 for ; Mon, 7 Sep 2020 09:52:00 +0000 (UTC) Date: Mon, 7 Sep 2020 09:52:00 +0000 (UTC) From: "Benjamin Lerer (Jira)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13935) Indexes and UDTs creation should have IF NOT EXISTS on its String representation 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-13935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17191610#comment-17191610 ] Benjamin Lerer commented on CASSANDRA-13935: -------------------------------------------- The patch for 4.0 looks good to me. I think we would need one for 3.0 and 3.11. > Indexes and UDTs creation should have IF NOT EXISTS on its String representation > -------------------------------------------------------------------------------- > > Key: CASSANDRA-13935 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13935 > Project: Cassandra > Issue Type: Bug > Components: Feature/2i Index, Legacy/CQL > Environment: Ubuntu 16.04.2 LTS > java version "1.8.0_144" > Java(TM) SE Runtime Environment (build 1.8.0_144-b01) > Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode) > Reporter: Javier Canillas > Assignee: Stefan Miklosovic > Priority: Low > Fix For: 4.0-beta > > Attachments: 13935-3.0.txt, 13935-3.11.txt, 13935-trunk.txt > > Time Spent: 10m > Remaining Estimate: 0h > > I came across something that bothers me a lot. I'm using snapshots to backup data from my Cassandra cluster in case something really bad happens (like dropping a table or a keyspace). > Exercising the recovery actions from those backups, I discover that the schema put on the file "schema.cql" as a result of the snapshot has the "CREATE IF NOT EXISTS" for the table, but not for the indexes. > When restoring from snapshots, and relying on the execution of these schemas to build up the table structure, everything seems fine for tables without secondary indexes, but for the ones that make use of them, the execution of these statements fail miserably. > Here I paste a generated schema.cql content for a table with indexes: > CREATE TABLE IF NOT EXISTS keyspace1.table1 ( > id text PRIMARY KEY, > content text, > last_update_date date, > last_update_date_time timestamp) > WITH ID = f1045fc0-2f59-11e7-95ec-295c3c064920 > AND bloom_filter_fp_chance = 0.01 > AND dclocal_read_repair_chance = 0.1 > AND crc_check_chance = 1.0 > AND default_time_to_live = 8640000 > AND gc_grace_seconds = 864000 > AND min_index_interval = 128 > AND max_index_interval = 2048 > AND memtable_flush_period_in_ms = 0 > AND read_repair_chance = 0.0 > AND speculative_retry = '99PERCENTILE' > AND caching = { 'keys': 'NONE', 'rows_per_partition': 'NONE' } > AND compaction = { 'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' } > AND compression = { 'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor' } > AND cdc = false > AND extensions = { }; > CREATE INDEX table1_last_update_date_idx ON keyspace1.table1 (last_update_date); > I think the last part should be: > CREATE INDEX IF NOT EXISTS table1_last_update_date_idx ON keyspace1.table1 (last_update_date); > // edit by Stefan Miklosovic > PR: https://github.com/apache/cassandra/pull/731 > I have added UDTs as part of this patch as well. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org