From fb26f1c86a7f63d80dc707b0029d77762ce5a309 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 24 Nov 2026 11:23:36 -0800 Subject: [PATCH] PHOENIX-8094 MetaDataEndPointIT turns off the CDC consumer MetaDataEndPointIT checks the size of the metadata cache. The CDC consumer of an earlier test can load a table into the cache during a later test, and the size check fails. The class now sets up its cluster with the parent properties and the CDC consumer off. Co-Authored-By: Claude Opus 5.5 --- .../phoenix/end2end/MetaDataEndPointIT.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetaDataEndPointIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetaDataEndPointIT.java index dfd21bf91c7..5e5234e673b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetaDataEndPointIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetaDataEndPointIT.java @@ -17,17 +17,22 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.hbase.index.IndexRegionObserver.PHOENIX_INDEX_CDC_CONSUMER_ENABLED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.sql.Connection; import java.sql.DriverManager; +import java.util.HashMap; +import java.util.Map; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.metrics2.lib.DynamicMetricsRegistry; +import org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants; import org.apache.phoenix.coprocessorclient.MetaDataProtocol.MutationCode; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.monitoring.IndexMetricsIT; +import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.schema.PIndexState; import org.apache.phoenix.schema.PTable; import org.apache.phoenix.schema.metrics.MetricsMetadataSource; @@ -35,7 +40,9 @@ import org.apache.phoenix.schema.metrics.MetricsMetadataSourceImpl; import org.apache.phoenix.util.EnvironmentEdgeManager; import org.apache.phoenix.util.IndexUtil; +import org.apache.phoenix.util.ReadOnlyProps; import org.apache.phoenix.util.SchemaUtil; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -60,6 +67,19 @@ */ @Category(NeedsOwnMiniClusterTest.class) public class MetaDataEndPointIT extends ParallelStatsDisabledIT { + + // This method hides the parent setup, so it must keep the same name. + // The CDC consumer is off because it loads tables into the metadata cache at random times. + @BeforeClass + public static synchronized void doSetup() throws Exception { + Map props = new HashMap<>(); + props.put(BaseScannerRegionObserverConstants.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY, + Integer.toString(60 * 60)); // An hour + props.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, Boolean.toString(false)); + props.put(PHOENIX_INDEX_CDC_CONSUMER_ENABLED, Boolean.toString(false)); + setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); + } + @Test public void testUpdateIndexState() throws Throwable { String schemaName = generateUniqueName();