palashc commented on code in PR #1952:
URL: https://github.com/apache/phoenix/pull/1952#discussion_r1715875593


##########
phoenix-core/src/it/java/org/apache/phoenix/cache/ServerMetadataCacheIT.java:
##########
@@ -1812,6 +1812,47 @@ public void testCacheUpdatedBeforeDDLOperations() throws 
Exception {
         }
     }
 
+    /**
+     * Test that last_ddl_timestamp validation is skipped when client's 
operation involves
+     * a table with 0<UCF<Long.MAX_VALUE.
+     */
+    @Test
+    public void testNoDDLTimestampValidationWithTableUCF() throws Exception {
+        String tableName = generateUniqueName();
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+        String url1 = QueryUtil.getConnectionUrl(props, config, "client1");
+        String url2 = QueryUtil.getConnectionUrl(props, config, "client2");
+        ConnectionQueryServices cqs1 = driver.getConnectionQueryServices(url1, 
props);
+        ConnectionQueryServices cqs2 = driver.getConnectionQueryServices(url2, 
props);
+        MetricsMetadataCachingSource metricsSource
+                = 
MetricsPhoenixCoprocessorSourceFactory.getInstance().getMetadataCachingSource();
+        //take a snapshot of current metric values
+        MetricsMetadataCachingSource.MetadataCachingMetricValues 
oldMetricValues
+                = metricsSource.getCurrentMetricValues();
+
+        try (Connection conn1 = cqs1.connect(url1, props);
+             Connection conn2 = cqs2.connect(url2, props)) {
+
+            // client-1 creates table with UCF=2days
+            createTableWithUCF(conn1, tableName, 2*24*60*60*1000L);
+
+            // query/upsert a few times with same and different client
+            for (int i=0; i<3; i++) {
+                query(conn2, tableName);
+                upsert(conn2, tableName, true);
+                query(conn1, tableName);
+                upsert(conn1, tableName, true);
+            }
+
+            MetricsMetadataCachingSource.MetadataCachingMetricValues 
newMetricValues
+                    = metricsSource.getCurrentMetricValues();
+
+            assertEquals("There should have been no timestamp validation 
requests.",
+                    0,
+                    newMetricValues.getValidateDDLTimestampRequestsCount()
+                            - 
oldMetricValues.getValidateDDLTimestampRequestsCount());

Review Comment:
   There will be requests from other tests, that's why I am checking the 
difference before and after just this test. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to