You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2016/03/21 21:48:27 UTC

ambari git commit: AMBARI-15495. ambari-server check-database has errors after upgrade to ambari 2.2.2.0 [grafana errors].(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4dfcaf886 -> c07a25dc9


AMBARI-15495. ambari-server check-database has errors after upgrade to ambari 2.2.2.0 [grafana errors].(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c07a25dc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c07a25dc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c07a25dc

Branch: refs/heads/branch-2.2
Commit: c07a25dc9b76b94c7d54f10db5882765669883d4
Parents: 4dfcaf8
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Mar 21 20:01:20 2016 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Mar 21 20:01:20 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/checks/CheckDatabaseHelper.java  | 2 +-
 .../org/apache/ambari/server/checks/CheckDatabaseHelperTest.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c07a25dc/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
index 652a49f..2719b89 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
@@ -321,7 +321,7 @@ public class CheckDatabaseHelper {
             "join serviceconfigmapping scm on sc.service_config_id=scm.service_config_id " +
             "join clusterconfig cc on scm.config_id=cc.config_id and sc.cluster_id=cc.cluster_id " +
             "join clusters c on cc.cluster_id=c.cluster_id and sc.stack_id=c.desired_stack_id " +
-            "where sc.group_id is null " +
+            "where sc.group_id is null and sc.service_config_id=(select max(service_config_id) from serviceconfig sc2 where sc2.service_name=sc.service_name and sc2.cluster_id=sc.cluster_id) " +
             "group by c.cluster_name, cs.service_name, cc.type_name, sc.version";
     String GET_NOT_SELECTED_SERVICE_CONFIGS_QUERY = "select c.cluster_name, cs.service_name, cc.type_name from clusterservices cs " +
             "join serviceconfig sc on cs.service_name=sc.service_name and cs.cluster_id=sc.cluster_id " +

http://git-wip-us.apache.org/repos/asf/ambari/blob/c07a25dc/ambari-server/src/test/java/org/apache/ambari/server/checks/CheckDatabaseHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/CheckDatabaseHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/CheckDatabaseHelperTest.java
index 66c6667..8d801dc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/CheckDatabaseHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/CheckDatabaseHelperTest.java
@@ -274,7 +274,7 @@ public class CheckDatabaseHelperTest {
             "join serviceconfigmapping scm on sc.service_config_id=scm.service_config_id " +
             "join clusterconfig cc on scm.config_id=cc.config_id and sc.cluster_id=cc.cluster_id " +
             "join clusters c on cc.cluster_id=c.cluster_id and sc.stack_id=c.desired_stack_id " +
-            "where sc.group_id is null " +
+            "where sc.group_id is null and sc.service_config_id=(select max(service_config_id) from serviceconfig sc2 where sc2.service_name=sc.service_name and sc2.cluster_id=sc.cluster_id) " +
             "group by c.cluster_name, cs.service_name, cc.type_name, sc.version")).andReturn(serviceConfigResultSet);
     expect(mockStatement.executeQuery("select c.cluster_name, cs.service_name, cc.type_name from clusterservices cs " +
             "join serviceconfig sc on cs.service_name=sc.service_name and cs.cluster_id=sc.cluster_id " +