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 5B239200D3A for ; Wed, 15 Nov 2017 22:46:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 59DA3160BF4; Wed, 15 Nov 2017 21:46:35 +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 A3AC8160C0B for ; Wed, 15 Nov 2017 22:46:34 +0100 (CET) Received: (qmail 1926 invoked by uid 500); 15 Nov 2017 21:46:31 -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 1562 invoked by uid 99); 15 Nov 2017 21:46:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2017 21:46:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 321D2F5E80; Wed, 15 Nov 2017 21:46:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: aweisberg@apache.org To: commits@cassandra.apache.org Date: Wed, 15 Nov 2017 21:46:43 -0000 Message-Id: In-Reply-To: <7b6f5caba1744195b9d4ab4d41a9d308@git.apache.org> References: <7b6f5caba1744195b9d4ab4d41a9d308@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/50] cassandra git commit: Add test verifying that a schema propagation adding a view over a non existing table doesn't prevent a node from start archived-at: Wed, 15 Nov 2017 21:46:35 -0000 Add test verifying that a schema propagation adding a view over a non existing table doesn't prevent a node from start patch by Andres de la Peña; reviewed by Jake Luciani for CASSANDRA-13737 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/95920874 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/95920874 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/95920874 Branch: refs/heads/master Commit: 959208749d70e5808aec144e87b73e90d56a7f91 Parents: 7e3bcfd Author: Andrés de la Peña Authored: Tue Aug 8 10:01:15 2017 +0100 Committer: Andrés de la Peña Committed: Tue Aug 8 10:01:15 2017 +0100 ---------------------------------------------------------------------- materialized_views_test.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/95920874/materialized_views_test.py ---------------------------------------------------------------------- diff --git a/materialized_views_test.py b/materialized_views_test.py index 306d719..77b20e6 100644 --- a/materialized_views_test.py +++ b/materialized_views_test.py @@ -1532,6 +1532,41 @@ class TestMaterializedViews(Tester): session.execute("DROP MATERIALIZED VIEW mv") session.execute("DROP TABLE test") + def propagate_view_creation_over_non_existing_table(self): + """ + The internal addition of a view over a non existing table should be ignored + @jira_ticket CASSANDRA-13737 + """ + + cluster = self.cluster + cluster.populate(3) + cluster.start() + node1, node2, node3 = self.cluster.nodelist() + session = self.patient_cql_connection(node1, consistency_level=ConsistencyLevel.QUORUM) + create_ks(session, 'ks', 3) + + session.execute('CREATE TABLE users (username varchar PRIMARY KEY, state varchar)') + + # create a materialized view only in nodes 1 and 2 + node3.stop(wait_other_notice=True) + session.execute(('CREATE MATERIALIZED VIEW users_by_state AS ' + 'SELECT * FROM users WHERE state IS NOT NULL AND username IS NOT NULL ' + 'PRIMARY KEY (state, username)')) + + # drop the base table only in node 3 + node1.stop(wait_other_notice=True) + node2.stop(wait_other_notice=True) + node3.start(wait_for_binary_proto=True) + session = self.patient_cql_connection(node3, consistency_level=ConsistencyLevel.QUORUM) + session.execute('DROP TABLE ks.users') + + # restart the cluster + cluster.stop() + cluster.start() + + # node3 should have received and ignored the creation of the MV over the dropped table + self.assertTrue(node3.grep_log('Not adding view users_by_state because the base table')) + # For read verification class MutationPresence(Enum): --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org