restorePartitionStates moved to sys pool instead of striped pool. - Fixes
@@ -33,6 +33,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
@@ -150,7 +151,6 @@ import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions;
import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.IgniteCollectors;
import org.apache.ignite.internal.util.InitializationProtector;
-import org.apache.ignite.internal.util.StripedExecutor;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -192,7 +192,6 @@ import static java.lang.String.format;
import static java.util.Arrays.asList;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_ALLOW_START_CACHES_IN_PARALLEL;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_REMOVED_ENTRIES_TTL;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK;
import static org.apache.ignite.IgniteSystemProperties.getBoolean;
@@ -5465,12 +5464,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
AtomicReference<IgniteCheckedException> restoreStateError = new AtomicReference<>();
- StripedExecutor stripedExec = ctx.getStripedExecutorService();
+ ExecutorService sysPool = ctx.getSystemExecutorService();
- int roundRobin = 0;
+ CountDownLatch completionLatch = new CountDownLatch(forGroups.size());
for (CacheGroupContext grp : forGroups) {
- stripedExec.execute(roundRobin % stripedExec.stripesCount(), () -> {
+ sysPool.execute(() -> {
try {
long processed = grp.offheap().restorePartitionStates(partitionStates);
@@ -5487,14 +5486,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
: new IgniteCheckedException(e)
);
}
+ finally {
+ completionLatch.countDown();
+ }
});
-
- roundRobin++;
}
try {
// Await completion restore state tasks in all stripes.
- stripedExec.awaitComplete();
+ completionLatch.await();
}
catch (InterruptedException e) {
throw new IgniteInterruptedException(e);
