You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/06/21 09:39:41 UTC
[1/2] ambari git commit: AMBARI-17279. BG operations windown appeared
after 90 seconds on clicking start all services (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.4 ed5ff0833 -> b92ba8203
refs/heads/trunk 4ea412353 -> 4c0779c8b
AMBARI-17279. BG operations windown appeared after 90 seconds on clicking start all services (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4c0779c8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4c0779c8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4c0779c8
Branch: refs/heads/trunk
Commit: 4c0779c8b548932dd6d96a0d2127d60c633c6b9b
Parents: 4ea4123
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 21 12:39:41 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 21 12:39:41 2016 +0300
----------------------------------------------------------------------
.../AmbariManagementControllerImpl.java | 19 +++++++++++----
.../server/state/ServiceComponentHost.java | 2 ++
.../svccomphost/ServiceComponentHostImpl.java | 25 ++++++++++++++++++++
3 files changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c0779c8/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 7dbb1ad..349668f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -181,6 +181,7 @@ import org.apache.ambari.server.state.stack.ServiceMetainfoXml;
import org.apache.ambari.server.state.stack.WidgetLayout;
import org.apache.ambari.server.state.stack.WidgetLayoutInfo;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent;
+import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpInProgressEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostUpgradeEvent;
@@ -2491,10 +2492,20 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
|| oldSchState == State.UNKNOWN
|| oldSchState == State.INSTALL_FAILED) {
roleCommand = RoleCommand.INSTALL;
- event = new ServiceComponentHostInstallEvent(
- scHost.getServiceComponentName(), scHost.getHostName(),
- nowTimestamp,
- scHost.getDesiredStackVersion().getStackId());
+
+ if (scHost.isClientComponent() && oldSchState == State.INSTALLED) {
+ // Client reinstalls are executed to reattach changed configs on service.
+ // Do not transition a client component to INSTALLING state if it was installed.
+ // Prevents INSTALL_FAILED state if a command gets aborted.
+ event = new ServiceComponentHostOpInProgressEvent(
+ scHost.getServiceComponentName(), scHost.getHostName(),
+ nowTimestamp);
+ } else {
+ event = new ServiceComponentHostInstallEvent(
+ scHost.getServiceComponentName(), scHost.getHostName(),
+ nowTimestamp,
+ scHost.getDesiredStackVersion().getStackId());
+ }
// If the state is transitioning from INIT TO INSTALLED and the cluster has Kerberos
// enabled, mark this ServiceComponentHost to see if anything needs to be done to
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c0779c8/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
index 464df17..586134c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
@@ -45,6 +45,8 @@ public interface ServiceComponentHost {
*/
String getServiceName();
+ boolean isClientComponent();
+
/**
* Get the ServiceComponent this object maps to
* @return Name of the ServiceComponent
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c0779c8/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 70af8ec..666111b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -192,6 +192,12 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
ServiceComponentHostEventType.HOST_SVCCOMP_OP_SUCCEEDED,
new ServiceComponentHostOpCompletedTransition())
+ // Allow transition on abort
+ .addTransition(State.INSTALLED,
+ State.INSTALLED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.INSTALLING,
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
@@ -303,6 +309,12 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+ // Allow transition on abort
+ .addTransition(State.STARTED,
+ State.STARTED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.STARTED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED,
@@ -476,10 +488,18 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+
+ // Allow transition on abort
+ .addTransition(State.INSTALLED,
+ State.INSTALLED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.INSTALLING,
State.INSTALL_FAILED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
@@ -1159,6 +1179,11 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
}
@Override
+ public boolean isClientComponent() {
+ return serviceComponent.isClientComponent();
+ }
+
+ @Override
public StackId getStackVersion() {
readLock.lock();
try {
[2/2] ambari git commit: AMBARI-17279. BG operations windown appeared
after 90 seconds on clicking start all services (aonishuk)
Posted by ao...@apache.org.
AMBARI-17279. BG operations windown appeared after 90 seconds on clicking start all services (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b92ba820
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b92ba820
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b92ba820
Branch: refs/heads/branch-2.4
Commit: b92ba8203fdec081729993ba2550c25f5e3da720
Parents: ed5ff08
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 21 12:39:43 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 21 12:39:43 2016 +0300
----------------------------------------------------------------------
.../AmbariManagementControllerImpl.java | 19 +++++++++++----
.../server/state/ServiceComponentHost.java | 2 ++
.../svccomphost/ServiceComponentHostImpl.java | 25 ++++++++++++++++++++
3 files changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b92ba820/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 7dbb1ad..349668f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -181,6 +181,7 @@ import org.apache.ambari.server.state.stack.ServiceMetainfoXml;
import org.apache.ambari.server.state.stack.WidgetLayout;
import org.apache.ambari.server.state.stack.WidgetLayoutInfo;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent;
+import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpInProgressEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostUpgradeEvent;
@@ -2491,10 +2492,20 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
|| oldSchState == State.UNKNOWN
|| oldSchState == State.INSTALL_FAILED) {
roleCommand = RoleCommand.INSTALL;
- event = new ServiceComponentHostInstallEvent(
- scHost.getServiceComponentName(), scHost.getHostName(),
- nowTimestamp,
- scHost.getDesiredStackVersion().getStackId());
+
+ if (scHost.isClientComponent() && oldSchState == State.INSTALLED) {
+ // Client reinstalls are executed to reattach changed configs on service.
+ // Do not transition a client component to INSTALLING state if it was installed.
+ // Prevents INSTALL_FAILED state if a command gets aborted.
+ event = new ServiceComponentHostOpInProgressEvent(
+ scHost.getServiceComponentName(), scHost.getHostName(),
+ nowTimestamp);
+ } else {
+ event = new ServiceComponentHostInstallEvent(
+ scHost.getServiceComponentName(), scHost.getHostName(),
+ nowTimestamp,
+ scHost.getDesiredStackVersion().getStackId());
+ }
// If the state is transitioning from INIT TO INSTALLED and the cluster has Kerberos
// enabled, mark this ServiceComponentHost to see if anything needs to be done to
http://git-wip-us.apache.org/repos/asf/ambari/blob/b92ba820/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
index 464df17..586134c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
@@ -45,6 +45,8 @@ public interface ServiceComponentHost {
*/
String getServiceName();
+ boolean isClientComponent();
+
/**
* Get the ServiceComponent this object maps to
* @return Name of the ServiceComponent
http://git-wip-us.apache.org/repos/asf/ambari/blob/b92ba820/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 70af8ec..666111b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -192,6 +192,12 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
ServiceComponentHostEventType.HOST_SVCCOMP_OP_SUCCEEDED,
new ServiceComponentHostOpCompletedTransition())
+ // Allow transition on abort
+ .addTransition(State.INSTALLED,
+ State.INSTALLED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.INSTALLING,
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
@@ -303,6 +309,12 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+ // Allow transition on abort
+ .addTransition(State.STARTED,
+ State.STARTED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.STARTED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED,
@@ -476,10 +488,18 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
+
+ // Allow transition on abort
+ .addTransition(State.INSTALLED,
+ State.INSTALLED,
+ ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
+ new ServiceComponentHostOpCompletedTransition())
+
.addTransition(State.INSTALLING,
State.INSTALL_FAILED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_FAILED,
@@ -1159,6 +1179,11 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
}
@Override
+ public boolean isClientComponent() {
+ return serviceComponent.isClientComponent();
+ }
+
+ @Override
public StackId getStackVersion() {
readLock.lock();
try {