You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Nate Cole <nc...@hortonworks.com> on 2017/01/05 13:12:59 UTC
Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/
-----------------------------------------------------------
Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
Bugs: AMBARI-19381
https://issues.apache.org/jira/browse/AMBARI-19381
Repository: ambari
Description
-------
The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
Long term, the cluster_version will no longer be used; that is a separate effort.
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
ambari-server/src/main/resources/properties.json b7e0988
ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 045d017
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 15e81c5
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
Diff: https://reviews.apache.org/r/55207/diff/
Testing
-------
Manual. Automated pending.
Thanks,
Nate Cole
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160602
-----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java (lines 120 - 121)
<https://reviews.apache.org/r/55207/#comment231736>
Either way - I'm fine leaving it. It's actually a nice pattern to have for testing. Lets you pass in mocks for these DAOs if you need to. Sometimes for tests it's easier to overload the ctor like this.
Anyway, it was just something to mention.
- Jonathan Hurley
On Jan. 5, 2017, 8:12 a.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 8:12 a.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 045d017
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 15e81c5
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated pending.
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
> On Jan. 5, 2017, 11:10 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql, line 185
> > <https://reviews.apache.org/r/55207/diff/1/?file=1597268#file1597268line185>
> >
> > Typo; extra NOT. Should be:
> >
> > repo_state VARCHAR2(255) DEFAULT 'INIT' NOT NULL,
Good catch. Will fix.
> On Jan. 5, 2017, 11:10 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java, lines 643-645
> > <https://reviews.apache.org/r/55207/diff/1/?file=1597264#file1597264line643>
> >
> > So the event which invokes this is done on a synchronous bus. I think it's synchronous b/c the heartbeat processor uses the results, so it has to be done on the thread handling the heartbeat.
> >
> > This method does a lot with the database, which will slow down the thread. On a large cluster, could this be a problem? If the heartbeat processor doesn't use the result of this method's calculations, then perhaps we can create a new async bus for this kind of stuff. It would still listen to the same event being fired from the heartbeat processor.
> >
> > Doesn't even need to change in this review - just thought I'd flag it for discussion.
There is a lot of DB work, but the amount done with this change isn't much more than what was there (one extra query). I'll open a new JIRA.
> On Jan. 5, 2017, 11:10 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java, lines 120-121
> > <https://reviews.apache.org/r/55207/diff/1/?file=1597264#file1597264line120>
> >
> > Just as a point (don't need to change it now), but unless the constructor (or a method it calls) needs these, you can just @Inject them and not worry about having them in the ctor.
Ah, yes, you're right - brain freeze from having to write jaaaaahhhhhvaahhhhhh :) Will fix, as I found a bunch of checkstyle warnings anyway.
- Nate
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160598
-----------------------------------------------------------
On Jan. 5, 2017, 8:12 a.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 8:12 a.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 045d017
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 15e81c5
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated pending.
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160598
-----------------------------------------------------------
Fix it, then Ship it!
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java (line 204)
<https://reviews.apache.org/r/55207/#comment231728>
Doc.
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java (lines 120 - 121)
<https://reviews.apache.org/r/55207/#comment231730>
Just as a point (don't need to change it now), but unless the constructor (or a method it calls) needs these, you can just @Inject them and not worry about having them in the ctor.
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java (lines 643 - 645)
<https://reviews.apache.org/r/55207/#comment231731>
So the event which invokes this is done on a synchronous bus. I think it's synchronous b/c the heartbeat processor uses the results, so it has to be done on the thread handling the heartbeat.
This method does a lot with the database, which will slow down the thread. On a large cluster, could this be a problem? If the heartbeat processor doesn't use the result of this method's calculations, then perhaps we can create a new async bus for this kind of stuff. It would still listen to the same event being fired from the heartbeat processor.
Doesn't even need to change in this review - just thought I'd flag it for discussion.
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql (line 185)
<https://reviews.apache.org/r/55207/#comment231732>
Typo; extra NOT. Should be:
repo_state VARCHAR2(255) DEFAULT 'INIT' NOT NULL,
- Jonathan Hurley
On Jan. 5, 2017, 8:12 a.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 8:12 a.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 045d017
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 15e81c5
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated pending.
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
> On Jan. 5, 2017, 1:59 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java, line 73
> > <https://reviews.apache.org/r/55207/diff/2/?file=1597647#file1597647line73>
> >
> > What should the behavior be if the record has a version of NONE? No comparison will happen.
By the time this code is invoked, we already know that serviceName and componentName are advertiseVersion=true, so any component that has not yet given us their version makes the logic the same (if we don't know the version, we're still OUT_OF_SYNC)
- Nate
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160613
-----------------------------------------------------------
On Jan. 5, 2017, 1:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 1:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
> On Jan. 5, 2017, 1:59 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java, line 73
> > <https://reviews.apache.org/r/55207/diff/2/?file=1597647#file1597647line73>
> >
> > What should the behavior be if the record has a version of NONE? No comparison will happen.
>
> Nate Cole wrote:
> By the time this code is invoked, we already know that serviceName and componentName are advertiseVersion=true, so any component that has not yet given us their version makes the logic the same (if we don't know the version, we're still OUT_OF_SYNC)
@Alejandro, does that explanation make sense? If the actual is NONE and desired is not NONE and it's version advertised, that OOS is correct behavior?
- Nate
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160613
-----------------------------------------------------------
On Jan. 5, 2017, 1:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 1:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Jonathan Hurley <jh...@hortonworks.com>.
> On Jan. 5, 2017, 1:59 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java, line 73
> > <https://reviews.apache.org/r/55207/diff/2/?file=1597647#file1597647line73>
> >
> > What should the behavior be if the record has a version of NONE? No comparison will happen.
>
> Nate Cole wrote:
> By the time this code is invoked, we already know that serviceName and componentName are advertiseVersion=true, so any component that has not yet given us their version makes the logic the same (if we don't know the version, we're still OUT_OF_SYNC)
>
> Nate Cole wrote:
> @Alejandro, does that explanation make sense? If the actual is NONE and desired is not NONE and it's version advertised, that OOS is correct behavior?
I don't understand the original issue here - HCS.version is NOT NULL in the DB and is initialized to UNKNOWN. Is there a NONE? I didn't think so. In any even != NONE is the same as != UNKNOWN, right?
- Jonathan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160613
-----------------------------------------------------------
On Jan. 5, 2017, 1:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 1:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160613
-----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java (line 73)
<https://reviews.apache.org/r/55207/#comment231746>
What should the behavior be if the record has a version of NONE? No comparison will happen.
- Alejandro Fernandez
On Jan. 5, 2017, 6:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 6:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160786
-----------------------------------------------------------
Ship it!
Ship It!
- Alejandro Fernandez
On Jan. 5, 2017, 6:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 6:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
> On Jan. 6, 2017, 1:57 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java, line 73
> > <https://reviews.apache.org/r/55207/diff/2/?file=1597647#file1597647line73>
> >
> > Based on the code, ":version" will never be NONE if we reach here.
> > However, if hcs.version is NONE, then it can't make the comparison at all.
> > I think we need to add "AND (hcs.version IS NONE OR hcs.version != :version)"
>
> Jonathan Hurley wrote:
> Doesn't "hcs.version" have to have a value - it's non-NULL, right? And it's initialized to UNKNOWN. I don't think we'd need the extra restriction in that case.
hcs.version can never be NONE (null); it is a non-nullable column whose default is 'UNKNOWN'. In that case, we are still OUT_OF_SYNC because of the not-equals check. Consider:
hcs1 UNKNOWN
hcs2 v2
hcs3 v2 (just passed as newVersion/:version)
hcs3 passing v2 in, the query will return result with only hcs1 based on the query, and the servicecomponent repo state must be moved to OUT_OF_SYNC.
- Nate
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160743
-----------------------------------------------------------
On Jan. 5, 2017, 1:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 1:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Jonathan Hurley <jh...@hortonworks.com>.
> On Jan. 6, 2017, 1:57 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java, line 73
> > <https://reviews.apache.org/r/55207/diff/2/?file=1597647#file1597647line73>
> >
> > Based on the code, ":version" will never be NONE if we reach here.
> > However, if hcs.version is NONE, then it can't make the comparison at all.
> > I think we need to add "AND (hcs.version IS NONE OR hcs.version != :version)"
Doesn't "hcs.version" have to have a value - it's non-NULL, right? And it's initialized to UNKNOWN. I don't think we'd need the extra restriction in that case.
- Jonathan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160743
-----------------------------------------------------------
On Jan. 5, 2017, 1:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 1:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/#review160743
-----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java (line 146)
<https://reviews.apache.org/r/55207/#comment231939>
If newVersion is empty, then we will never call
the DB query findByServiceAndComponentAndNotVersion
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java (line 73)
<https://reviews.apache.org/r/55207/#comment231941>
Based on the code, ":version" will never be NONE if we reach here.
However, if hcs.version is NONE, then it can't make the comparison at all.
I think we need to add "AND (hcs.version IS NONE OR hcs.version != :version)"
- Alejandro Fernandez
On Jan. 5, 2017, 6:37 p.m., Nate Cole wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55207/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 6:37 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
>
>
> Bugs: AMBARI-19381
> https://issues.apache.org/jira/browse/AMBARI-19381
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
>
> Long term, the cluster_version will no longer be used; that is a separate effort.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
> ambari-server/src/main/resources/properties.json b7e0988
> ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
> ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
> ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
>
> Diff: https://reviews.apache.org/r/55207/diff/
>
>
> Testing
> -------
>
> Manual. Automated:
>
>
> Results :
>
> Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
>
>
> Thanks,
>
> Nate Cole
>
>
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/
-----------------------------------------------------------
(Updated Jan. 5, 2017, 1:37 p.m.)
Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
Bugs: AMBARI-19381
https://issues.apache.org/jira/browse/AMBARI-19381
Repository: ambari
Description
-------
The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
Long term, the cluster_version will no longer be used; that is a separate effort.
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
ambari-server/src/main/resources/properties.json b7e0988
ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
Diff: https://reviews.apache.org/r/55207/diff/
Testing (updated)
-------
Manual. Automated:
Results :
Tests run: 4837, Failures: 0, Errors: 0, Skipped: 37
Thanks,
Nate Cole
Re: Review Request 55207: Heartbeat version transitions must update
Component alongside Cluster
Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55207/
-----------------------------------------------------------
(Updated Jan. 5, 2017, 12:51 p.m.)
Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, and Jonathan Hurley.
Changes
-------
Fix for comments and checkstyle fixes.
Bugs: AMBARI-19381
https://issues.apache.org/jira/browse/AMBARI-19381
Repository: ambari
Description
-------
The repository version per component and state of the repository should be updated on heartbeat just as cluster is.
Long term, the cluster_version will no longer be used; that is a separate effort.
Diffs (updated)
-----
ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java 0046ec6
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java 9dbda20
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java 65cfcaa
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 7c90cab
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java f5a5b0c
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java cc7b503
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java 987e44f
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java 9d35e2a
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java 210de62
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java 9b93517
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentVersionEntity.java 5085d18
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java e93ab9a
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java 236091b
ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java 7d35d2e
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java d6bbbac
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b79c945
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1c502bc
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c6d4ad0
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1be87bb
ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql abe48e8
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 169a464
ambari-server/src/main/resources/properties.json b7e0988
ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java 7758924
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java 3529bef
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java fb508ea
ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java ead0a2d
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java 0f615ee
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java 36afa03
Diff: https://reviews.apache.org/r/55207/diff/
Testing
-------
Manual. Automated pending.
Thanks,
Nate Cole