From 5a306955a41ca55ba45af43fd151942a0eafb949 Mon Sep 17 00:00:00 2001 From: litao Date: Wed, 8 Sep 2021 12:38:55 +0800 Subject: [PATCH] HDFS-16209. Add description for dfs.namenode.caching.enabled (#3378) --- .../src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java | 1 + .../hadoop-hdfs/src/main/resources/hdfs-default.xml | 4 ++++ .../src/site/markdown/CentralizedCacheManagement.md | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java index ac0363f1c4..f6c54dd043 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java @@ -462,6 +462,7 @@ public class DFSConfigKeys extends CommonConfigurationKeys { public static final long DFS_NAMENODE_PATH_BASED_CACHE_REFRESH_INTERVAL_MS_DEFAULT = 30000L; public static final String DFS_NAMENODE_CACHING_ENABLED_KEY = "dfs.namenode.caching.enabled"; + // TODO: Default value to be set false in 4.0.0 release onwards (HDFS-16209) public static final boolean DFS_NAMENODE_CACHING_ENABLED_DEFAULT = true; /** Pending period of block deletion since NameNode startup */ diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml index 642057fe00..7b580d2e34 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml @@ -2868,6 +2868,10 @@ maintain a mapping of cached blocks to DataNodes via processing DataNode cache reports. Based on these reports and addition and removal of caching directives, the NameNode will schedule caching and uncaching work. + In the current implementation, centralized caching introduces additional + write lock overhead (see CacheReplicationMonitor#rescan) even if no path + to cache is specified, so we recommend disabling this feature when not in + use. We will disable centralized caching by default in later versions. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/CentralizedCacheManagement.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/CentralizedCacheManagement.md index 6fc383871f..da3d45c206 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/CentralizedCacheManagement.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/CentralizedCacheManagement.md @@ -256,7 +256,7 @@ The following properties are not required, but may be specified for tuning: * dfs.namenode.caching.enabled - This parameter can be used to enable/disable the centralized caching in NameNode. When centralized caching is disabled, NameNode will not process cache reports or store information about block cache locations on the cluster. Note that NameNode will continute to store the path based cache locations in the file-system metadata, even though it will not act on this information until the caching is enabled. The default value for this parameter is true (i.e. centralized caching is enabled). + This parameter can be used to enable/disable the centralized caching in NameNode. When centralized caching is disabled, NameNode will not process cache reports or store information about block cache locations on the cluster. Note that NameNode will continute to store the path based cache locations in the file-system metadata, even though it will not act on this information until the caching is enabled. The default value for this parameter is true (i.e. centralized caching is enabled). In the current implementation, centralized caching introduces additional write lock overhead (see CacheReplicationMonitor#rescan) even if no path to cache is specified, so we recommend disabling this feature when not in use. We will disable centralized caching by default in later versions. * dfs.datanode.pmem.cache.recovery