Prechádzať zdrojové kódy

AMBARI-5018 Rolling restart should work on a Service that is in MaintMode. (ababiichuk)

aBabiichuk 11 rokov pred
rodič
commit
e788c8b816

+ 1 - 1
ambari-web/app/controllers/main/service/item.js

@@ -205,7 +205,7 @@ App.MainServiceItemController = Em.Controller.extend({
   },
 
   rollingRestart: function(hostComponentName) {
-    batchUtils.launchHostComponentRollingRestart(hostComponentName, false);
+    batchUtils.launchHostComponentRollingRestart(hostComponentName, false, this.get('content.passiveState') === "ON");
   },
 
   turnOnOffPassiveRequest: function(state,message) {

+ 5 - 3
ambari-web/app/utils/batch_scheduled_requests.js

@@ -215,9 +215,9 @@ module.exports = {
    *           Pre-select host-components which have stale
    *          configurations
    */
-  launchHostComponentRollingRestart: function(hostComponentName, staleConfigsOnly) {
+  launchHostComponentRollingRestart: function(hostComponentName, staleConfigsOnly, skipMaintenance) {
     if (App.get('components.rollinRestartAllowed').contains(hostComponentName)) {
-      this.showRollingRestartPopup(hostComponentName, staleConfigsOnly);
+      this.showRollingRestartPopup(hostComponentName, staleConfigsOnly, null, skipMaintenance);
     }
     else {
       this.showWarningRollingRestartPopup(hostComponentName);
@@ -231,7 +231,7 @@ module.exports = {
    * @param {App.hostComponent[]} hostComponents list of hostComponents that should be restarted (optional).
    * Using this parameter will reset hostComponentName
    */
-  showRollingRestartPopup: function(hostComponentName, staleConfigsOnly, hostComponents) {
+  showRollingRestartPopup: function(hostComponentName, staleConfigsOnly, hostComponents, skipMaintenance) {
     hostComponents = hostComponents || [];
     var componentDisplayName = App.format.role(hostComponentName);
     if (!componentDisplayName) {
@@ -241,6 +241,7 @@ module.exports = {
     var viewExtend = {
       staleConfigsOnly : staleConfigsOnly,
       hostComponentName : hostComponentName,
+      skipMaintenance: skipMaintenance,
       didInsertElement : function() {
         this.set('parentView.innerView', this);
         this.initialize();
@@ -255,6 +256,7 @@ module.exports = {
       header : title,
       hostComponentName : hostComponentName,
       staleConfigsOnly : staleConfigsOnly,
+      skipMaintenance: skipMaintenance,
       innerView : null,
       bodyClass : App.RollingRestartView.extend(viewExtend),
       classNames : [ 'rolling-restart-popup' ],

+ 8 - 1
ambari-web/app/views/common/rolling_restart_view.js

@@ -38,6 +38,13 @@ App.RollingRestartView = Em.View.extend({
    */
   staleConfigsOnly : false,
 
+  /**
+   * We should do rolling restart for components if we run
+   * restart for service and service is in Maintenance mode
+   * @type {bool}
+   */
+  skipMaintenance: false,
+
   /**
    * Count of host components in one batch
    * @type {Number}
@@ -139,7 +146,7 @@ App.RollingRestartView = Em.View.extend({
    * @type {Array}
    */
   restartHostComponents : function() {
-    var hostComponents = this.get('nonMaintainanceHostComponents');
+    var hostComponents = this.get('skipMaintenance') ? this.get('allHostComponents') : this.get('nonMaintainanceHostComponents');
     if (this.get('staleConfigsOnly')) {
       hostComponents = hostComponents.filterProperty('staleConfigs', true);
     }