oleg-vlsk commented on code in PR #13216:
URL: https://github.com/apache/ignite/pull/13216#discussion_r3376603924


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryLocalTxRollbackTest.java:
##########
@@ -0,0 +1,263 @@
+/*
+ * 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.ignite.internal.processors.cache.query.continuous;
+
+import java.util.Map;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+import javax.cache.Cache;
+import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cluster.ClusterState;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.failure.StopNodeFailureHandler;
+import org.apache.ignite.internal.GridKernalState;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/**
+ * Tests interaction between local continuous queries created with {@link 
ContinuousQuery#setLocal(boolean)} set to
+ * {@code true} and transaction rollback counter cleanup.
+ * <p>
+ * When a transactional update is rolled back, {@code IgniteTxHandler} closes 
the corresponding partition update
+ * counter gaps and calls {@code 
CacheContinuousQueryManager#skipUpdateCounter} for the rolled back counters. 
These
+ * skipped counters are needed by distributed continuous queries to release 
pending events after gaps caused by
+ * rolled back updates.
+ * <p>
+ * Local continuous queries are different: their regular update events are 
delivered directly to the local listener and
+ * do not use the distributed partition recovery path based on skipped update 
counters. Therefore, local-only continuous
+ * query listeners must not be passed into {@code skipUpdateCounter}. 
Otherwise, the local-only handler may reach the
+ * unsupported {@code loc == true && locOnly == true} path in
+ * {@code 
CacheContinuousQueryHandler.CacheContinuousQueryListener#skipUpdateCounter}.
+ * <p>
+ * This class verifies that local continuous queries are ignored by 
skipped-counter processing, while ordinary
+ * distributed continuous queries continue to work correctly.
+ */
+@RunWith(Parameterized.class)
+public class CacheContinuousQueryLocalTxRollbackTest extends 
GridCommonAbstractTest {

Review Comment:
   Class renamed.



-- 
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