-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50196/
-----------------------------------------------------------

(Updated July 19, 2016, 4:56 p.m.)


Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Nate Cole.


Changes
-------

Caught a problem where STOP commands created from `<group xsi:type="stop">` are 
_CUSTOM COMMANDS_


Bugs: AMBARI-17796
    https://issues.apache.org/jira/browse/AMBARI-17796


Repository: ambari


Description
-------

This is a specific issues on an EU downgrade from 2.5 to 2.4. Here's the 
scenario:

- Ranger supported "Audit to DB" up to HDP 2.5. It was removed in HDP 2.5. 
Along with it, the properties in {{admin-properties}} were removed as well.
- The Ranger {{params.py}} uses the {{check_stack_feature}} to determine if 
"Audit to DB" is supported and if it is, tries to extract the properties it 
needs.

All is well and good at this point. The problem comes when a downgrade happens.

- When downgrading from 2.5 to 2.4 the 2.4 configurations should be restored. 
However, this doesn't happen on an EU until after the {{STOP}} command is 
issued for upgraded services. It's during this {{STOP}} command that we run 
into an issue. Ranger is running on 2.5, so the 2.5 configurations are sent to 
stop it. However, the version that we're downgrading to is 2.4, so it thinks 
that it needs to extract the audit properties.

- On the {{RESTART}} of Ranger on the downgrade, it should be extracting the 
audit properties since the 2.4 configurations are sent. But the {{STOP}} 
command is for 2.5 and doesn't have them. 

So, this means that {{STOP}} and {{RESTART}} are using different configurations 
on an EU downgrade. We basically need to create a way to reliably determine 
which stack version should be used for feature checks.

```
Traceback (most recent call last):
  File 
\"/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py\",
 line 199, in <module>
    RangerAdmin().execute()
  File 
\"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\",
 line 280, in execute
    method(env)
  File 
\"/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py\",
 line 60, in stop
    import params
  File 
\"/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/params.py\",
 line 176, in <module>
    audit_jdbc_url = 
format('jdbc:postgresql://{db_host}/{ranger_auditdb_name}') if 
stack_supports_ranger_audit_db else None
  File 
\"/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py\",
 line 95, in format
    return ConfigurationFormatter().format(format_string, args, **result)
  File 
\"/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py\",
 line 59, in format
    result_protected = self.vformat(format_string, args, all_params)
  File \"/usr/lib/python2.7/string.py\", line 549, in vformat
    result = self._vformat(format_string, args, kwargs, used_args, 2)
  File \"/usr/lib/python2.7/string.py\", line 582, in _vformat
    result.append(self.format_field(obj, format_spec))
  File \"/usr/lib/python2.7/string.py\", line 599, in format_field
    return format(value, format_spec)
  File 
\"/usr/lib/python2.6/site-packages/resource_management/libraries/script/config_dictionary.py\",
 line 73, in __getattr__
    raise Fail(\"Configuration parameter '\" + self.name + \"' was not found in 
configurations dictionary!\")
resource_management.core.exceptions.Fail: Configuration parameter 
'audit_db_name' was not found in configurations dictionary!
```


Diffs (updated)
-----

  
ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py
 5db1718 
  
ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
 5a3c723 
  
ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
 7d1682d 
  
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
 93987be 
  
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
 6f8d588 
  
ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
 9068b0c 
  
ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
 ac21b49 
  
ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
 6ff833b 
  
ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
 6814ca2 
  
ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
 9c6f384 
  
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
 b5a4c99 
  ambari-server/src/test/python/TestStackFeature.py PRE-CREATION 

Diff: https://reviews.apache.org/r/50196/diff/


Testing
-------

----------------------------------------------------------------------
Total run:1025
Total errors:0
Total failures:0
OK


Thanks,

Jonathan Hurley

Reply via email to