Log restore partition state start and finish events with elapsed time - Fixes
@@ -2289,8 +2289,20 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
}
}
- if (!metastoreOnly)
- restorePartitionStates(partStates, null);
+ if (!metastoreOnly) {
+ long startRestorePart = U.currentTimeMillis();
+
+ if (log.isInfoEnabled())
+ log.info("Restoring partition state for local groups [cntPartStateWal="
+ + partStates.size() + ", lastCheckpointId=" + status.cpStartId + ']');
+
+ long proc = restorePartitionStates(partStates, null);
+
+ if (log.isInfoEnabled())
+ log.info("Finished restoring partition state for local groups [cntProcessed=" + proc +
+ ", cntPartStateWal=" + partStates.size() +
+ ", time=" + (U.currentTimeMillis() - startRestorePart) + "ms]");
+ }
}
finally {
if (!metastoreOnly)
@@ -2308,12 +2320,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
*
* @param partStates Partition states restored from WAL.
* @param onlyForGroups If not {@code null} restore states only for specified cache groups.
+ * @return cntParts Count of partitions processed.
* @throws IgniteCheckedException If failed to restore partition states.
*/
- private void restorePartitionStates(
+ private long restorePartitionStates(
Map<T2<Integer, Integer>, T2<Integer, Long>> partStates,
@Nullable Set<Integer> onlyForGroups
) throws IgniteCheckedException {
+ long cntParts = 0;
+
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (grp.isLocal() || !grp.affinityNode()) {
// Local cache has no partitions and its states.
@@ -2400,11 +2415,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
updateState(part, restore.get1());
}
+
+ cntParts++;
}
// After partition states are restored, it is necessary to update internal data structures in topology.
grp.topology().afterStateRestored(grp.topology().lastTopologyChangeVersion());
}
+
+ return cntParts;
}
/**
