AMBARI-25863: Fix a problem where the 'supported-refresh-commands' Element in configuration files for service was invalided (#3646)
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 096250b..4c0a940 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -1743,15 +1743,22 @@
String type = changedConfigType.getKey();
stale |= (serviceInfo.hasConfigDependency(type) || componentInfo.hasConfigType(type));
if (stale) {
- changedProperties.addAll(changedConfigType.getValue());
+ for (String propertyName : changedConfigType.getValue()) {
+ changedProperties.add(type + "/" + propertyName);
+ }
}
}
String refreshCommand = calculateRefreshCommand(stackInfo.getRefreshCommandConfiguration(), sch, changedProperties);
+ Map<String, HostConfig> actual = sch.getActualConfigs();
+
+ Map<String, Map<String, String>> desired = getEffectiveDesiredTags(cluster, sch.getHostName(),cluster.getDesiredConfigs());
+
if (STALE_CONFIGS_CACHE_ENABLED) {
if (refreshCommand != null) {
- int staleHash = Objects.hashCode(cluster.getDesiredConfigs().hashCode(),
+ int staleHash = Objects.hashCode(actual.hashCode(),
+ desired.hashCode(),
sch.getHostName(),
sch.getServiceComponentName(),
sch.getServiceName());
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/core-site.xml b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/core-site.xml
index 3b1c148..8e42060 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/core-site.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/core-site.xml
@@ -194,7 +194,7 @@
<on-ambari-upgrade add="true"/>
</property>
<property>
- <name>hadoop.proxyuser.*</name>
+ <name>hadoop.proxyuser</name>
<value/>
<description>
This * property is not configured it's used just to define refresh commands for all properties
@@ -203,6 +203,9 @@
<supported-refresh-commands>
<refresh-command componentName="NAMENODE" command="reloadproxyusers" />
</supported-refresh-commands>
+ <value-attributes>
+ <empty-value-valid>true</empty-value-valid>
+ </value-attributes>
<on-ambari-upgrade add="false"/>
</property>
<property>
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
index 7b9ffc4..c849160 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
@@ -129,6 +129,13 @@
<scriptType>PYTHON</scriptType>
</commandScript>
</customCommand>
+ <customCommand>
+ <name>RECONFIGURE</name>
+ <commandScript>
+ <script>scripts/namenode.py</script>
+ <scriptType>PYTHON</scriptType>
+ </commandScript>
+ </customCommand>
</customCommands>
</component>