alex-plekhanov commented on code in PR #13834: URL: https://github.com/apache/ignite/pull/13834#discussion_r4632674177
########## modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexRowCacheCrossTablePoisonTest.java: ########## @@ -0,0 +1,252 @@ +/* + * 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.index; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.cache.Cache; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.QueryEntity; +import org.apache.ignite.cache.query.SqlQuery; +import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.cache.query.index.sorted.IndexRowCache; +import org.apache.ignite.internal.cache.query.index.sorted.IndexRowImpl; +import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow; +import org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter; +import org.apache.ignite.testframework.GridTestUtils; +import org.jsr166.ConcurrentLinkedHashMap; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + +/** + * Tests that a stale {@link IndexRowCache} entry left by a row of one cache is not served to index + * operations of another cache of the same cache group. + * <p> + * The index row cache is group-level and is keyed by a bare data row link, while a link is only + * an address: after a bulk free that bypasses per-row row-cache cleanup (e.g. a partition destroy Review Comment: Looks like this PR not fixes the root cause. I think it's better to clean onheap cache on partition destroy rather than keep stale records and try to workaraund it on row lookup. There is another hidden problem of this patch, when cluster rebalanced twice, and one partition moved from the current node, and after the second rebalance returned back. In this case different row with the same cache id can reuse old link and checking cache id in row cache can't detect such a problem, but cleaning row cache on partition destroy - will solve the problem. -- 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]
