Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8C391200CD8 for ; Wed, 2 Aug 2017 11:59:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8AB38169282; Wed, 2 Aug 2017 09:59:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AA0CC169281 for ; Wed, 2 Aug 2017 11:59:05 +0200 (CEST) Received: (qmail 67943 invoked by uid 500); 2 Aug 2017 09:59:04 -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 67932 invoked by uid 99); 2 Aug 2017 09:59:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2017 09:59:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3770B1A1D30 for ; Wed, 2 Aug 2017 09:59:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id JAtmMIzTFYer for ; Wed, 2 Aug 2017 09:59:03 +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 2E4945FE37 for ; Wed, 2 Aug 2017 09:59:02 +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 76857E0D45 for ; Wed, 2 Aug 2017 09:59:01 +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 558A624652 for ; Wed, 2 Aug 2017 09:59:00 +0000 (UTC) Date: Wed, 2 Aug 2017 09:59:00 +0000 (UTC) From: =?utf-8?Q?Andr=C3=A9s_de_la_Pe=C3=B1a_=28JIRA=29?= To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13737) Node start can fail if the base table of a materialized view is not found MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 02 Aug 2017 09:59:06 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13737?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D16110650#comment-16110650 ]=20 Andr=C3=A9s de la Pe=C3=B1a commented on CASSANDRA-13737: ----------------------------------------------- Here is a very simple patch that simply ignores (and warns about) the inter= nal addition of materialized views whose base table is unknown: ||[3.0|https://github.com/apache/cassandra/compare/cassandra-3.0...adelapen= a:13737-3.0]||[3.11|https://github.com/apache/cassandra/compare/cassandra-3= .11...adelapena:13737-3.11]||[trunk|https://github.com/apache/cassandra/com= pare/cassandra-3.0...adelapena:13737-trunk]||[dtest|https://github.com/apac= he/cassandra-dtest/compare/master...adelapena:13737] > Node start can fail if the base table of a materialized view is not found > ------------------------------------------------------------------------- > > Key: CASSANDRA-13737 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1373= 7 > Project: Cassandra > Issue Type: Bug > Components: Distributed Metadata, Materialized Views > Reporter: Andr=C3=A9s de la Pe=C3=B1a > Assignee: Andr=C3=A9s de la Pe=C3=B1a > Fix For: 3.0.x, 3.11.x, 4.x > > > Node start can fail if the base table of a materialized view is not found= , which is something that can happen under certain circumstances. There is = a dtest reproducing the problem: > {code} > cluster =3D self.cluster > cluster.populate(3) > cluster.start() > node1, node2, node3 =3D self.cluster.nodelist() > session =3D self.patient_cql_connection(node1, consistency_level=3DConsis= tencyLevel.QUORUM) > create_ks(session, 'ks', 3) > session.execute('CREATE TABLE users (username varchar PRIMARY KEY, state = varchar)') > node3.stop(wait_other_notice=3DTrue) > # create a materialized view only in nodes 1 and 2 > session.execute(('CREATE MATERIALIZED VIEW users_by_state AS ' > 'SELECT * FROM users WHERE state IS NOT NULL AND usernam= e IS NOT NULL ' > 'PRIMARY KEY (state, username)')) > node1.stop(wait_other_notice=3DTrue) > node2.stop(wait_other_notice=3DTrue) > # drop the base table only in node 3 > node3.start(wait_for_binary_proto=3DTrue) > session =3D self.patient_cql_connection(node3, consistency_level=3DConsis= tencyLevel.QUORUM) > session.execute('DROP TABLE ks.users') > cluster.stop() > cluster.start() # Fails > {code} > This is the error during node start: > {code} > java.lang.IllegalArgumentException: Unknown CF 958ebc30-76e4-11e7-869a-9d= 8367a71c76 > =09at org.apache.cassandra.db.Keyspace.getColumnFamilyStore(Keyspace.java= :215) ~[main/:na] > =09at org.apache.cassandra.db.view.ViewManager.addView(ViewManager.java:1= 43) ~[main/:na] > =09at org.apache.cassandra.db.view.ViewManager.reload(ViewManager.java:11= 3) ~[main/:na] > =09at org.apache.cassandra.schema.Schema.alterKeyspace(Schema.java:618) ~= [main/:na] > =09at org.apache.cassandra.schema.Schema.lambda$merge$18(Schema.java:591)= ~[main/:na] > =09at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.lambda$e= ntryConsumer$0(Collections.java:1575) ~[na:1.8.0_131] > =09at java.util.HashMap$EntrySet.forEach(HashMap.java:1043) ~[na:1.8.0_13= 1] > =09at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.forEach(= Collections.java:1580) ~[na:1.8.0_131] > =09at org.apache.cassandra.schema.Schema.merge(Schema.java:591) ~[main/:n= a] > =09at org.apache.cassandra.schema.Schema.mergeAndAnnounceVersion(Schema.j= ava:564) ~[main/:na] > =09at org.apache.cassandra.schema.MigrationTask$1.response(MigrationTask.= java:89) ~[main/:na] > =09at org.apache.cassandra.net.ResponseVerbHandler.doVerb(ResponseVerbHan= dler.java:53) ~[main/:na] > =09at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTas= k.java:72) ~[main/:na] > =09at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:= 511) ~[na:1.8.0_131] > =09at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0= _131] > =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecuto= r.java:1142) ~[na:1.8.0_131] > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:617) [na:1.8.0_131] > =09at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLoc= alDeallocator$0(NamedThreadFactory.java:81) [main/:na] > =09at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_131] > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org