diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryWithRegionMovesIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryWithRegionMovesIT.java index f6c122b5017..2bdeefbb141 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryWithRegionMovesIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryWithRegionMovesIT.java @@ -72,6 +72,9 @@ public abstract class BaseQueryWithRegionMovesIT extends ParallelStatsDisabledWi @BeforeParam public static synchronized void initTables(String idxDdl, boolean columnEncoded, boolean keepDeletedCells) throws Exception { + // Parameter setup runs before the per-test hook, and a subclass can replace the class setup. + // Thus turn the balancer off here too, before the tables are created. + getUtility().getAdmin().balancerSwitch(false, true); StringBuilder optionBuilder = new StringBuilder(); if (!columnEncoded) { optionBuilder.append("COLUMN_ENCODED_BYTES=0"); diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsDisabledWithRegionMovesIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsDisabledWithRegionMovesIT.java index e556f808d7c..b089a2237ab 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsDisabledWithRegionMovesIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsDisabledWithRegionMovesIT.java @@ -56,6 +56,7 @@ import org.apache.phoenix.util.QueryBuilder; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.AfterClass; +import org.junit.Before; import org.junit.BeforeClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -117,6 +118,19 @@ public static synchronized void doSetup() throws Exception { TestScanningResultPostDummyResultCaller.class.getName()); props.put(PHOENIX_INDEX_CDC_CONSUMER_ENABLED, Boolean.toString(false)); setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); + // Turn the balancer off before any parameter setup creates tables. + getUtility().getAdmin().balancerSwitch(false, true); + } + + /** + * The tests move regions on their own schedule. Balancer moves can drop admin compaction requests + * and can move SYSTEM.CATALOG during DDL. Thus the balancer stays off. The class setup turns it + * off first. This method is not static and has a distinct name, so subclasses that hide doSetup + * also use it. + */ + @Before + public void disableBalancer() throws Exception { + getUtility().getAdmin().balancerSwitch(false, true); } @AfterClass