You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2015/04/22 06:14:03 UTC

Review Request 33430: Configuration Versions Should Be Calculated By the Database

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

Review request for Ambari, Alejandro Fernandez, Nate Cole, and Tom Beerbower.


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


Repository: ambari


Description
-------

{{ConfigVersionHelper}} is used by Ambari to determine the "next" version when creating configuration versions and service configuration versions. This presents two problems:

- In a distributed system, have an in-memory atomic does not work. When Ambari becomes HA aware, this will be problematic.

- It does not support downgrading and removing the current maximum. There would need to be code added in various places to always remember to decrement this value. The decoupled nature is prone it error.

Instead, this class should be removed in favor of calculate this from the database using a max() function on the column. This will allow removal of configurations during downgrade to properly revert to the prior configuration version.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java 55e2aef 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java 1b9d33d 
  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java 68d88ca 
  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java 86b919f 
  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java a687c5e 
  ambari-server/src/main/java/org/apache/ambari/server/state/ConfigVersionHelper.java a7e9b5a 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 496eda5 
  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java 3cde243 
  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ConcurrentServiceConfigVersionTest.java PRE-CREATION 

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


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley


Re: Review Request 33430: Configuration Versions Should Be Calculated By the Database

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33430/#review81150
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On April 22, 2015, 12:14 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33430/
> -----------------------------------------------------------
> 
> (Updated April 22, 2015, 12:14 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-10639
>     https://issues.apache.org/jira/browse/AMBARI-10639
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> {{ConfigVersionHelper}} is used by Ambari to determine the "next" version when creating configuration versions and service configuration versions. This presents two problems:
> 
> - In a distributed system, have an in-memory atomic does not work. When Ambari becomes HA aware, this will be problematic.
> 
> - It does not support downgrading and removing the current maximum. There would need to be code added in various places to always remember to decrement this value. The decoupled nature is prone it error.
> 
> Instead, this class should be removed in favor of calculate this from the database using a max() function on the column. This will allow removal of configurations during downgrade to properly revert to the prior configuration version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java 55e2aef 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java 1b9d33d 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java 68d88ca 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java 86b919f 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java a687c5e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ConfigVersionHelper.java a7e9b5a 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 496eda5 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java 3cde243 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ConcurrentServiceConfigVersionTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/33430/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 33430: Configuration Versions Should Be Calculated By the Database

Posted by Tom Beerbower <tb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33430/#review81151
-----------------------------------------------------------

Ship it!


Ship It!

- Tom Beerbower


On April 22, 2015, 4:14 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33430/
> -----------------------------------------------------------
> 
> (Updated April 22, 2015, 4:14 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-10639
>     https://issues.apache.org/jira/browse/AMBARI-10639
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> {{ConfigVersionHelper}} is used by Ambari to determine the "next" version when creating configuration versions and service configuration versions. This presents two problems:
> 
> - In a distributed system, have an in-memory atomic does not work. When Ambari becomes HA aware, this will be problematic.
> 
> - It does not support downgrading and removing the current maximum. There would need to be code added in various places to always remember to decrement this value. The decoupled nature is prone it error.
> 
> Instead, this class should be removed in favor of calculate this from the database using a max() function on the column. This will allow removal of configurations during downgrade to properly revert to the prior configuration version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java 55e2aef 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java 1b9d33d 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java 68d88ca 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java 86b919f 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java a687c5e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ConfigVersionHelper.java a7e9b5a 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 496eda5 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java 3cde243 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ConcurrentServiceConfigVersionTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/33430/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>