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 7A10B18C34 for ; Wed, 13 May 2015 17:02:02 +0000 (UTC) Received: (qmail 36939 invoked by uid 500); 13 May 2015 17:02:01 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 36904 invoked by uid 500); 13 May 2015 17:02: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 36892 invoked by uid 99); 13 May 2015 17:02:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2015 17:02:01 +0000 Date: Wed, 13 May 2015 17:02:01 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-9310) Table change response returns as keyspace change response 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-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14542236#comment-14542236 ] Tyler Hobbs commented on CASSANDRA-9310: ---------------------------------------- [~beobal] I understand your hesitation to change our native protocol response at this point in 2.0, but it should be quite safe for one reason: we will be returning the exact same message that we already return for index creation. If drivers can handle index creation responses correctly, they will be able to handle index drop responses correctly. I would like to avoid forcing the drivers to fetch _all_ keyspace metadata when they don't need to, since this can become pretty expensive for some clusters. > Table change response returns as keyspace change response > --------------------------------------------------------- > > Key: CASSANDRA-9310 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9310 > Project: Cassandra > Issue Type: Bug > Environment: C* 1.2.19 and 2.0.14 | python-driver master (upcoming v. 2.6) > Reporter: Kishan Karunaratne > Assignee: Carl Yeksigian > Fix For: 2.1.x, 2.0.x > > Attachments: 9310-1.2.txt, 9310-2.0.txt, 9310-2.1.txt > > > When an index is dropped, its existence is still persisted across the keyspace metadata. This happens because the response to drop the index from the metadata is never received, as a keyspace change response is (incorrectly) received by the driver instead of a table change response. Related to PYTHON-241: https://datastax-oss.atlassian.net/browse/PYTHON-241 > Test: > {noformat} > self.session.execute("CREATE TABLE %s (k int PRIMARY KEY, a int)" % self.table_name) > ks_meta = self.cluster.metadata.keyspaces[self.keyspace_name] > table_meta = ks_meta.tables[self.table_name] > self.assertNotIn('a_idx', ks_meta.indexes) > self.assertNotIn('b_idx', ks_meta.indexes) > self.assertNotIn('a_idx', table_meta.indexes) > self.assertNotIn('b_idx', table_meta.indexes) > self.session.execute("CREATE INDEX a_idx ON %s (a)" % self.table_name) > self.session.execute("ALTER TABLE %s ADD b int" % self.table_name) > self.session.execute("CREATE INDEX b_idx ON %s (b)" % self.table_name) > ks_meta = self.cluster.metadata.keyspaces[self.keyspace_name] > table_meta = ks_meta.tables[self.table_name] > self.assertIsInstance(ks_meta.indexes['a_idx'], IndexMetadata) > self.assertIsInstance(ks_meta.indexes['b_idx'], IndexMetadata) > self.assertIsInstance(table_meta.indexes['a_idx'], IndexMetadata) > self.assertIsInstance(table_meta.indexes['b_idx'], IndexMetadata) > # both indexes updated when index dropped > self.session.execute("DROP INDEX a_idx") > ks_meta = self.cluster.metadata.keyspaces[self.keyspace_name] > table_meta = ks_meta.tables[self.table_name] > self.assertNotIn('a_idx', ks_meta.indexes) > {noformat} > Output: > {noformat} > AssertionError: 'a_idx' unexpectedly found in {u'b_idx': , u'a_idx': } > {noformat} > Debug log: > {noformat} > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: , Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Fetched keyspace info for index_map_tests, rebuilding metadata > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched keyspace info for index_map_tests, rebuilding metadata > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: test_index_updates, Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: Ignoring schedule_unique for already-scheduled task: (>, (u'index_map_tests', u'test_index_updates', None)) > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: test_index_updates, Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: test_index_updates, Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: test_index_updates, Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.cluster: DEBUG: [control connection] Fetched table info for index_map_tests.test_index_updates, rebuilding metadata > cassandra.connection: DEBUG: Message pushed from server: > cassandra.cluster: DEBUG: Refreshing schema in response to schema change. Keyspace: index_map_tests; Table: , Type: None > cassandra.cluster: DEBUG: [control connection] Waiting for schema agreement > cassandra.cluster: DEBUG: [control connection] Schemas mismatched, trying again > cassandra.cluster: DEBUG: [control connection] Schemas match > cassandra.cluster: DEBUG: [control connection] Fetched keyspace info for index_map_tests, rebuilding metadata > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)