palashc commented on code in PR #2208: URL: https://github.com/apache/phoenix/pull/2208#discussion_r2181293224
########## phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCStreamIT.java: ########## @@ -168,6 +172,42 @@ public void testOnlyOneStreamAllowed() throws Exception { assertStreamStatus(conn, tableName, streamName, CDCUtil.CdcStreamStatus.ENABLING); } + @Test + public void testStreamMetadataWhenTableIsDropped() throws SQLException { + Connection conn = newConnection(); + MetaDataClient mdc = new MetaDataClient(conn.unwrap(PhoenixConnection.class)); + String schemaName = "\"" + generateUniqueName().toLowerCase() + "\""; + String tableName = SchemaUtil.getTableName(schemaName, "\"" + generateUniqueName().toLowerCase() + "\""); + String unescapedFullTableName = SchemaUtil.getUnEscapedFullName(tableName); + String create_table_sql = "CREATE TABLE " + tableName + " ( k INTEGER PRIMARY KEY," + " v1 INTEGER, v2 DATE)"; + conn.createStatement().execute(create_table_sql); + String cdcName = "\"" + generateUniqueName().toLowerCase() + "\""; + String cdc_sql = "CREATE CDC " + cdcName + " ON " + tableName; + conn.createStatement().execute(cdc_sql); + TaskRegionObserver.SelfHealingTask task = + new TaskRegionObserver.SelfHealingTask( + taskRegionEnvironment, + QueryServicesOptions.DEFAULT_TASK_HANDLING_MAX_INTERVAL_MS); + task.run(); + String partitionQuery = "SELECT * FROM SYSTEM.CDC_STREAM WHERE TABLE_NAME='" + unescapedFullTableName + "'"; Review Comment: These checks do that: `Assert.assertNotNull(mdc.getStreamNameIfCDCEnabled(unescapedFullTableName));` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org