wernerdv commented on code in PR #13554:
URL: https://github.com/apache/ignite/pull/13554#discussion_r4129730591
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionConcurrentWritesAbstractTest.java:
##########
@@ -19,86 +19,28 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-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.internal.IgniteEx;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.GridTestUtils;
import org.junit.Test;
-import static
org.apache.ignite.configuration.DataStorageConfiguration.DFLT_PAGE_SIZE;
-
-/**
- * Concurrent deadlock test for size-aware page eviction.
- * <p>
- * The region is first filled with a large number of small entries (so there
is plenty of evictable page space), then
- * several threads concurrently insert large rows (larger than the empty-pages
pool). Each large insert goes through
- * the size-aware reserve and, for the single-row path, eviction under the new
entry lock with the non-blocking
- * {@code tryLockEntry}. The average data volume is kept within the region
capacity, so eviction frees already-stored
- * small entries rather than overrunning the free list. The test asserts that
no deadlock occurs (all threads finish
- * within a global deadline).
- */
-public abstract class PageEvictionConcurrentWritesAbstractTest extends
GridCommonAbstractTest {
- /** Off-heap region size. */
- private static final int SIZE = 256 * 1024 * 1024;
-
- /** Partition count (kept low so that index-tree structures do not exhaust
the region). */
- private static final int PARTITIONS = 32;
-
- /** Large record size (larger than the empty-pages pool so that each write
is size-aware). */
- private static final int LARGE_RECORD_SIZE = 2 * 1024 * 1024;
-
- /** Small record size used to pre-fill the region with evictable data. */
- private static final int SMALL_RECORD_SIZE = 4096;
-
- /** Empty pages pool size. */
- private static final int POOL_SIZE = 100;
-
- /** Number of small pre-fill entries, leaving a buffer that is exceeded by
the total of the large writes, so that
- * the last of them can only be stored by freeing pages via size-aware
eviction. The large records are small
- * enough that concurrent size-aware eviction reliably frees the required
pages (no spurious guard OOM). */
- private static final int SMALL_ENTRIES = 48_000;
-
- /** Number of writer threads. */
- private static final int THREADS = 2;
-
- /** Large rows inserted per thread. Their total (threads x rows) exceeds
the buffer left by the pre-fill, so the
- * last large writes overflow the region and require size-aware eviction
to free small entry pages. */
- private static final int LARGE_ROWS_PER_THREAD = 20;
-
- /** Global deadline for the whole test (protects against a
deadlock/busy-spin hang). */
- private static final long DEADLINE = TimeUnit.MINUTES.toMillis(3);
-
+/** Concurrent deadlock test for size-aware page eviction. */
+public abstract class PageEvictionConcurrentWritesAbstractTest extends
PageEvictionAbstractTest {
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName)
throws Exception {
- return super.getConfiguration(gridName)
- .setDataStorageConfiguration(new DataStorageConfiguration()
- .setDefaultDataRegionConfiguration(new
DataRegionConfiguration()
- .setInitialSize(SIZE)
- .setMaxSize(SIZE)
- .setEmptyPagesPoolSize(POOL_SIZE))
- .setPageSize(DFLT_PAGE_SIZE));
+ return
super.getConfiguration(gridName).setDataStorageConfiguration(new
DataStorageConfiguration());
Review Comment:
Fixed
--
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]