tkhurana commented on code in PR #2566: URL: https://github.com/apache/phoenix/pull/2566#discussion_r3624678078
########## phoenix-core/src/it/java/org/apache/phoenix/replication/ReplicationLogGroupEventualIndexIT.java: ########## @@ -0,0 +1,144 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.replication; + +import static org.apache.phoenix.hbase.index.IndexRegionObserver.PHOENIX_INDEX_CDC_CONSUMER_ENABLED; +import static org.apache.phoenix.query.BaseTest.generateUniqueName; + +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.util.Arrays; +import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; +import org.apache.phoenix.jdbc.FailoverPhoenixConnection; +import org.apache.phoenix.util.CDCUtil; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +/** + * CDC index behind a CONSISTENCY=EVENTUAL secondary index. Lives in its own IT (not in + * {@link ReplicationLogGroupIT}) because the {@code serializeCDCMutations} variant is a + * cluster-level config and is exercised by the + * {@link ReplicationLogGroupEventualIndexWithSerializeCDCIT} subclass, which inherits exactly this + * one test. The base class runs it under the default {@code serializeCDCMutations=false}. + */ +@Category(NeedsOwnMiniClusterTest.class) +public class ReplicationLogGroupEventualIndexIT extends ReplicationLogGroupBaseIT { + + @BeforeClass + public static void doSetup() throws Exception { + setupEventualIndexClusters(); + } + + /** + * Disables the IndexCDCConsumer on both clusters, then starts them. CDC-index regeneration is + * verified directly and the consumer's downstream secondary-index convergence is out of scope, so + * it stays off. The {@code serializeCDCMutations} subclass calls this after setting its own + * toggle so the consumer-disable lives in one place. + */ + protected static void setupEventualIndexClusters() throws Exception { + conf1.setBoolean(PHOENIX_INDEX_CDC_CONSUMER_ENABLED, false); + conf2.setBoolean(PHOENIX_INDEX_CDC_CONSUMER_ENABLED, false); Review Comment: @virajjasani Added the test for eventually consistent index -- 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]
