You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Alejandro Fernandez <af...@hortonworks.com> on 2014/11/09 20:11:07 UTC

Re: Review Request 27783: Blueprint fails when %HOSTGROUP::name% followed by another %

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

(Updated Nov. 9, 2014, 7:11 p.m.)


Review request for Ambari, John Speidel, Mahadev Konar, Sumit Mohanty, Srimanth Gunturi, and Sid Wagle.


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


Repository: ambari


Description
-------

I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and Slider, then exported the blueprint, and removed Ganglia from it.

Then, I attempted to create a single node cluster using the blueprints and ran into a regex error.

The problem is that one of the properties contains %HOSTGROUP::name% followed by another % and the regex match tries to do greedy matching instead of minimal.
For example, storm-site.xml had worker.childopts with
```
-Xmx768m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
```

While the regex expression in BlueprintConfigurationProcessor.java is,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+)%");
```

Instead, it should be,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+?)%");
```

Steps to repro,
```
curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d @hdp_22_blueprint.json
curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d @single_node_cluster.json
```


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java f1a6110 

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


Testing
-------

mvn clean test

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27:50.444s
[INFO] Finished at: Sat Nov 08 18:08:04 PST 2014
[INFO] Final Memory: 56M/486M
[INFO] ------------------------------------------------------------------------


Thanks,

Alejandro Fernandez


Re: Review Request 27783: Blueprint fails when %HOSTGROUP::name% followed by another %

Posted by Yusaku Sako <yu...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27783/#review60529
-----------------------------------------------------------

Ship it!


Ship It!

- Yusaku Sako


On Nov. 10, 2014, 12:02 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27783/
> -----------------------------------------------------------
> 
> (Updated Nov. 10, 2014, 12:02 a.m.)
> 
> 
> Review request for Ambari, John Speidel, Mahadev Konar, Sumit Mohanty, Srimanth Gunturi, and Sid Wagle.
> 
> 
> Bugs: AMBARI-8233
>     https://issues.apache.org/jira/browse/AMBARI-8233
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and Slider, then exported the blueprint, and removed Ganglia from it.
> 
> Then, I attempted to create a single node cluster using the blueprints and ran into a regex error.
> 
> The problem is that one of the properties contains %HOSTGROUP::name% followed by another % and the regex match tries to do greedy matching instead of minimal.
> For example, storm-site.xml had worker.childopts with
> ```
> -Xmx768m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
> ```
> 
> While the regex expression in BlueprintConfigurationProcessor.java is,
> ```
> private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+)%");
> ```
> 
> Instead, it should be,
> ```
> private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+?)%");
> ```
> 
> Steps to repro,
> ```
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d @hdp_22_blueprint.json
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d @single_node_cluster.json
> ```
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java f1a6110 
> 
> Diff: https://reviews.apache.org/r/27783/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 27:50.444s
> [INFO] Finished at: Sat Nov 08 18:08:04 PST 2014
> [INFO] Final Memory: 56M/486M
> [INFO] ------------------------------------------------------------------------
> 
> I also verified that this works by copying over the jar file and using the blueprint and topology json files in AMBARI-8233's attachments.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 27783: Blueprint fails when %HOSTGROUP::name% followed by another %

Posted by Jaimin Jetly <ja...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27783/#review60528
-----------------------------------------------------------

Ship it!


Ship It!

- Jaimin Jetly


On Nov. 10, 2014, 12:02 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27783/
> -----------------------------------------------------------
> 
> (Updated Nov. 10, 2014, 12:02 a.m.)
> 
> 
> Review request for Ambari, John Speidel, Mahadev Konar, Sumit Mohanty, Srimanth Gunturi, and Sid Wagle.
> 
> 
> Bugs: AMBARI-8233
>     https://issues.apache.org/jira/browse/AMBARI-8233
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and Slider, then exported the blueprint, and removed Ganglia from it.
> 
> Then, I attempted to create a single node cluster using the blueprints and ran into a regex error.
> 
> The problem is that one of the properties contains %HOSTGROUP::name% followed by another % and the regex match tries to do greedy matching instead of minimal.
> For example, storm-site.xml had worker.childopts with
> ```
> -Xmx768m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
> ```
> 
> While the regex expression in BlueprintConfigurationProcessor.java is,
> ```
> private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+)%");
> ```
> 
> Instead, it should be,
> ```
> private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+?)%");
> ```
> 
> Steps to repro,
> ```
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d @hdp_22_blueprint.json
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d @single_node_cluster.json
> ```
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java f1a6110 
> 
> Diff: https://reviews.apache.org/r/27783/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 27:50.444s
> [INFO] Finished at: Sat Nov 08 18:08:04 PST 2014
> [INFO] Final Memory: 56M/486M
> [INFO] ------------------------------------------------------------------------
> 
> I also verified that this works by copying over the jar file and using the blueprint and topology json files in AMBARI-8233's attachments.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 27783: Blueprint fails when %HOSTGROUP::name% followed by another %

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27783/
-----------------------------------------------------------

(Updated Nov. 10, 2014, 12:02 a.m.)


Review request for Ambari, John Speidel, Mahadev Konar, Sumit Mohanty, Srimanth Gunturi, and Sid Wagle.


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


Repository: ambari


Description
-------

I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and Slider, then exported the blueprint, and removed Ganglia from it.

Then, I attempted to create a single node cluster using the blueprints and ran into a regex error.

The problem is that one of the properties contains %HOSTGROUP::name% followed by another % and the regex match tries to do greedy matching instead of minimal.
For example, storm-site.xml had worker.childopts with
```
-Xmx768m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
```

While the regex expression in BlueprintConfigurationProcessor.java is,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+)%");
```

Instead, it should be,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+?)%");
```

Steps to repro,
```
curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d @hdp_22_blueprint.json
curl -H "X-Requested-By:ambari" -X POST -u admin:admin http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d @single_node_cluster.json
```


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java f1a6110 

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


Testing (updated)
-------

mvn clean test

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27:50.444s
[INFO] Finished at: Sat Nov 08 18:08:04 PST 2014
[INFO] Final Memory: 56M/486M
[INFO] ------------------------------------------------------------------------

I also verified that this works by copying over the jar file and using the blueprint and topology json files in AMBARI-8233's attachments.


Thanks,

Alejandro Fernandez