You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2021/11/10 07:39:56 UTC

[ignite] branch master updated: IGNITE-15882 isInfoEnabled() check before logging on info level - Fixes #9555.

This is an automated email from the ASF dual-hosted git repository.

sergeychugunov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 1649eb2  IGNITE-15882 isInfoEnabled() check before logging on info level - Fixes #9555.
1649eb2 is described below

commit 1649eb2a1433f7bdfd01a992b67320e3e76be005
Author: Kirill Tkalenko <tk...@yandex.ru>
AuthorDate: Wed Nov 10 10:35:02 2021 +0300

    IGNITE-15882 isInfoEnabled() check before logging on info level - Fixes #9555.
    
    Signed-off-by: Sergey Chugunov <se...@gmail.com>
---
 .../GridCacheDatabaseSharedManager.java            | 31 +++++++++++++---------
 1 file changed, 19 insertions(+), 12 deletions(-)

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 48c84de..a63fdf5 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
@@ -646,13 +646,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
             long newSize = (long)(region.getMaxSize() * shrinkPercentage);
             long newInitSize = Math.min(region.getInitialSize(), newSize);
 
-            log.info("Region size was reassigned by defragmentation reason: " +
-                "region = '" + region.getName() + "', " +
-                "oldInitialSize = '" + region.getInitialSize() + "', " +
-                "newInitialSize = '" + newInitSize + "', " +
-                "oldMaxSize = '" + region.getMaxSize() + "', " +
-                "newMaxSize = '" + newSize
-            );
+            if (log.isInfoEnabled()) {
+                log.info("Region size was reassigned by defragmentation reason: " +
+                    "region = '" + region.getName() + "', " +
+                    "oldInitialSize = '" + region.getInitialSize() + "', " +
+                    "newInitialSize = '" + newInitSize + "', " +
+                    "oldMaxSize = '" + region.getMaxSize() + "', " +
+                    "newMaxSize = '" + newSize
+                );
+            }
 
             region.setMaxSize(newSize);
             region.setInitialSize(newInitSize);
@@ -1101,7 +1103,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
         long time = System.currentTimeMillis();
 
         try {
-            log.info("Starting binary memory restore for: " + cctx.cache().cacheGroupDescriptors().keySet());
+            if (log.isInfoEnabled())
+                log.info("Starting binary memory restore for: " + cctx.cache().cacheGroupDescriptors().keySet());
 
             for (DatabaseLifecycleListener lsnr : getDatabaseListeners(cctx.kernalContext()))
                 lsnr.beforeBinaryMemoryRestore(this);
@@ -3673,8 +3676,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
                 // We roll memory up until we find a checkpoint start record registered in the status.
                 if (F.eq(cpRec.checkpointId(), status.cpStartId)) {
-                    log.info("Found last checkpoint marker [cpId=" + cpRec.checkpointId() +
-                        ", pos=" + rec.position() + ']');
+                    if (log.isInfoEnabled()) {
+                        log.info("Found last checkpoint marker [cpId=" + cpRec.checkpointId() +
+                            ", pos=" + rec.position() + ']');
+                    }
 
                     needApplyBinaryUpdates = false;
                 }
@@ -3699,8 +3704,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
          * @return Flag indicates need throws CRC exception or not.
          */
         @Override public boolean throwsCRCError() {
-            log.info("Throws CRC error check [needApplyBinaryUpdates=" + needApplyBinaryUpdates +
-                ", lastArchivedSegment=" + lastArchivedSegment + ", lastRead=" + lastReadRecordPointer() + ']');
+            if (log.isInfoEnabled()) {
+                log.info("Throws CRC error check [needApplyBinaryUpdates=" + needApplyBinaryUpdates +
+                    ", lastArchivedSegment=" + lastArchivedSegment + ", lastRead=" + lastReadRecordPointer() + ']');
+            }
 
             if (needApplyBinaryUpdates)
                 return true;