skorotkov commented on code in PR #12026:
URL: https://github.com/apache/ignite/pull/12026#discussion_r2159169364


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/Random2LruPageEvictionPutLargeObjectsTest.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * 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.eviction.paged;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.configuration.DataPageEvictionMode;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.junits.WithSystemProperty;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static 
org.apache.ignite.configuration.DataStorageConfiguration.DFLT_PAGE_SIZE;
+import static 
org.apache.ignite.internal.processors.cache.eviction.paged.PageEvictionAbstractTest.setEvictionMode;
+
+/** */
+public class Random2LruPageEvictionPutLargeObjectsTest extends 
GridCommonAbstractTest {
+    /** Offheap size for memory policy. */
+    private static final int SIZE = 1024 * 1024 * 1024;
+
+    /** Record size. */
+    private static final int RECORD_SIZE = 80 * 1024 * 1024;
+
+    /** Number of entries. */
+    static final int ENTRIES = 100;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName)
+            .setDataStorageConfiguration(new DataStorageConfiguration()
+                .setDefaultDataRegionConfiguration(new 
DataRegionConfiguration()
+                    .setInitialSize(SIZE)
+                    .setMaxSize(SIZE)
+                )
+                .setPageSize(DFLT_PAGE_SIZE)
+            );
+
+        return setEvictionMode(DataPageEvictionMode.RANDOM_2_LRU, cfg);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    @WithSystemProperty(key = "IGNITE_DUMP_THREADS_ON_FAILURE", value = 
"false")
+    public void testPutLargeObjects() throws Exception {
+        IgniteEx ignite = startGrids(2);
+
+        IgniteCache<Integer, Object> cache = 
ignite.createCache(DEFAULT_CACHE_NAME);
+
+        Affinity<Integer> aff = ignite.affinity(DEFAULT_CACHE_NAME);
+
+        Object val = new byte[RECORD_SIZE];
+
+        int counter = 0;
+
+        for (int key = 1; key <= ENTRIES; key++) {
+            // Skip keys local node is primary for to force async processing 
in system striped pool in the non-local node.
+            if (!aff.isPrimary(ignite.localNode(), key)) {

Review Comment:
   To demonstrate the "Possible starvation in striped pool" warnings from the 
remote node grid(1).
   
   Otherwise the test-runner-* thread which insert syncronously into the 
grid(0) can start eviction too early and  hang before the eviction would start 
in the grid(1).
   



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to