You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2018/08/24 13:42:24 UTC
ignite git commit: IGNITE-9351 Log restore partition state start and
finish events with elapsed time - Fixes #4595.
Repository: ignite
Updated Branches:
refs/heads/master 5994a58a8 -> 4eb657b01
IGNITE-9351 Log restore partition state start and finish events with elapsed time - Fixes #4595.
Signed-off-by: Dmitriy Pavlov <dp...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4eb657b0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4eb657b0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4eb657b0
Branch: refs/heads/master
Commit: 4eb657b0153246666a3ed4de6f523eb9e4af2bc5
Parents: 5994a58
Author: Dmitriy Pavlov <dp...@apache.org>
Authored: Fri Aug 24 16:42:07 2018 +0300
Committer: Dmitriy Pavlov <dp...@apache.org>
Committed: Fri Aug 24 16:42:07 2018 +0300
----------------------------------------------------------------------
.../GridCacheDatabaseSharedManager.java | 25 +++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4eb657b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index f955231..bd8a62f 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -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;
}
/**