You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by di...@apache.org on 2016/12/14 20:08:40 UTC

ambari git commit: AMBARI-19156 Install Packages fails with the old stack has services removed in the new stack (dili)

Repository: ambari
Updated Branches:
  refs/heads/trunk 7dcabf565 -> 162ee83c5


AMBARI-19156 Install Packages fails with the old stack has services removed in the new stack (dili)


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

Branch: refs/heads/trunk
Commit: 162ee83c552e2c418cc2ee97dbb3687ffc8e1ae3
Parents: 7dcabf5
Author: Di Li <di...@apache.org>
Authored: Wed Dec 14 15:08:13 2016 -0500
Committer: Di Li <di...@apache.org>
Committed: Wed Dec 14 15:08:13 2016 -0500

----------------------------------------------------------------------
 .../server/api/services/AmbariMetaInfo.java     |  6 ++++
 .../ClusterStackVersionResourceProvider.java    |  9 +++++
 .../apache/ambari/server/stack/BaseModule.java  |  2 +-
 .../ambari/server/stack/ExtensionModule.java    |  6 ++--
 .../ambari/server/stack/ServiceModule.java      |  6 ++--
 .../apache/ambari/server/stack/StackModule.java | 20 ++++++++---
 .../apache/ambari/server/state/StackInfo.java   | 12 +++++++
 .../AmbariManagementControllerTest.java         |  2 +-
 .../ambari/server/stack/StackManagerTest.java   | 38 ++++++++++++++++++--
 .../ambari/server/stack/StackModuleTest.java    | 11 ++++++
 .../HDP/2.0.6/services/SPARK/metainfo.xml       | 33 +++++++++++++++++
 .../HDP/2.0.7/services/SPARK/metainfo.xml       | 34 ++++++++++++++++++
 .../HDP/2.0.7/services/SPARK2/metainfo.xml      | 33 +++++++++++++++++
 .../HDP/2.0.8/services/SPARK2/metainfo.xml      | 34 ++++++++++++++++++
 .../HDP/2.0.8/services/SPARK3/metainfo.xml      | 33 +++++++++++++++++
 15 files changed, 265 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 23a4a27..13f3b9a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -549,6 +549,12 @@ public class AmbariMetaInfo {
     return service;
   }
 
+  public boolean isServiceRemovedInStack(String stackName, String version, String serviceName) throws AmbariException{
+    StackInfo stack = getStack(stackName, version);
+    List<String> removedServices = stack.getRemovedServices();
+    return removedServices.contains(serviceName);
+  }
+
   public Collection<String> getMonitoringServiceNames(String stackName, String version)
     throws AmbariException{
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index d417ec2..f2fd9ac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -626,6 +626,15 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
     }
     List<String> blacklistedPackagePrefixes = configuration.getRollingUpgradeSkipPackagesPrefixes();
     for (String serviceName : servicesOnHost) {
+      try{
+        if(ami.isServiceRemovedInStack(stackId.getStackName(), stackId.getStackVersion(), serviceName)){
+          LOG.info(String.format("%s has been removed from stack %s-%s. Skip calculating its installation packages", stackId.getStackName(), stackId.getStackVersion(), serviceName));
+          continue; //No need to calculate install packages for removed services
+        }
+      } catch (AmbariException e1) {
+        throw new SystemException(String.format("Cannot obtain stack information for %s-%s", stackId.getStackName(), stackId.getStackVersion()), e1);
+      }
+
       ServiceInfo info;
       try {
         info = ami.getService(stackId.getStackName(), stackId.getStackVersion(), serviceName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
index 28b8e46..fc49539 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
@@ -72,8 +72,8 @@ public abstract class BaseModule<T, I> implements StackDefinitionModule<T, I> {
         if (parentModules.containsKey(id)) {
           module.resolve(parentModules.get(id), allStacks, commonServices, extensions);
         }
-        mergedModules.add(module);
       }
+      mergedModules.add(module);
     }
 
     // add non-overlapping parent modules

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
index 51b6104..f67d5d2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
@@ -248,8 +248,10 @@ public class ExtensionModule extends BaseModule<ExtensionModule, ExtensionInfo>
     Collection<ServiceModule> mergedModules = mergeChildModules(
         allStacks, commonServices, extensions, serviceModules, parentExtension.serviceModules);
     for (ServiceModule module : mergedModules) {
-      serviceModules.put(module.getId(), module);
-      extensionInfo.getServices().add(module.getModuleInfo());
+      if(!module.isDeleted()){
+        serviceModules.put(module.getId(), module);
+        extensionInfo.getServices().add(module.getModuleInfo());
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
index c027f7f..fdcbacf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
@@ -585,8 +585,10 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
         allStacks, commonServices, extensions, componentModules, parent.componentModules);
     componentModules.clear();
     for (ComponentModule module : mergedModules) {
-      componentModules.put(module.getId(), module);
-      serviceInfo.getComponents().add(module.getModuleInfo());
+      if (!module.isDeleted()){
+        componentModules.put(module.getId(), module);
+        serviceInfo.getComponents().add(module.getModuleInfo());
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index ce606de..24ba686 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -319,10 +319,18 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     stackInfo.getServices().clear();
     Collection<ServiceModule> mergedModules = mergeChildModules(
         allStacks, commonServices, extensions, serviceModules, parentStack.serviceModules);
+
+    List<String> removedServices = new ArrayList<String>();
+
     for (ServiceModule module : mergedModules) {
-      serviceModules.put(module.getId(), module);
-      stackInfo.getServices().add(module.getModuleInfo());
+      if (module.isDeleted()){
+        removedServices.add(module.getId());
+      } else {
+        serviceModules.put(module.getId(), module);
+        stackInfo.getServices().add(module.getModuleInfo());
+      }
     }
+    stackInfo.setRemovedServices(removedServices);
   }
 
   /**
@@ -670,9 +678,11 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     Collection<ConfigurationModule> mergedModules = mergeChildModules(
         allStacks, commonServices, extensions, configurationModules, parent.configurationModules);
     for (ConfigurationModule module : mergedModules) {
-      configurationModules.put(module.getId(), module);
-      stackInfo.getProperties().addAll(module.getModuleInfo().getProperties());
-      stackInfo.setConfigTypeAttributes(module.getConfigType(), module.getModuleInfo().getAttributes());
+      if(!module.isDeleted()){
+        configurationModules.put(module.getId(), module);
+        stackInfo.getProperties().addAll(module.getModuleInfo().getProperties());
+        stackInfo.setConfigTypeAttributes(module.getConfigType(), module.getModuleInfo().getAttributes());
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index bd60e3a..3ecc2f9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -76,6 +76,11 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   private Set<String> errorSet = new HashSet<String>();
   private RepositoryXml repoXml = null;
 
+  /**
+   * List of services removed from current stack
+   * */
+  private List<String> removedServices = new ArrayList<String>();
+
   public String getMinJdk() {
     return minJdk;
   }
@@ -561,4 +566,11 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     return repoXml;
   }
 
+  public List<String> getRemovedServices() {
+    return removedServices;
+  }
+
+  public void setRemovedServices(List<String> removedServices) {
+    this.removedServices = removedServices;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 9509d89..f351b27 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -7334,7 +7334,7 @@ public class AmbariManagementControllerTest {
   public void testGetStackServices() throws Exception {
     StackServiceRequest request = new StackServiceRequest(STACK_NAME, NEW_STACK_VERSION, null);
     Set<StackServiceResponse> responses = controller.getStackServices(Collections.singleton(request));
-    Assert.assertEquals(11, responses.size());
+    Assert.assertEquals(12, responses.size());
 
 
     StackServiceRequest requestWithParams = new StackServiceRequest(STACK_NAME, NEW_STACK_VERSION, SERVICE_NAME);

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
index 8263f72..87a1fc7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
@@ -154,6 +154,27 @@ public class StackManagerTest {
   }
 
   @Test
+  public void testServiceRemoved() {
+    StackInfo stack = stackManager.getStack("HDP", "2.0.8");
+    ServiceInfo service = stack.getService("SPARK");
+    assertNull(service);
+    service = stack.getService("SPARK2");
+    assertNull(service);
+    List<String> removedServices = stack.getRemovedServices();
+    assertEquals(removedServices.size(), 2);
+
+    HashSet<String> expectedServices = new HashSet<String>();
+    expectedServices.add("SPARK");
+    expectedServices.add("SPARK2");
+
+    for (String s : removedServices) {
+      assertTrue(expectedServices.remove(s));
+    }
+    assertTrue(expectedServices.isEmpty());
+
+  }
+
+  @Test
   public void testGetStack() {
     StackInfo stack = stackManager.getStack("HDP", "0.1");
     assertNotNull(stack);
@@ -239,8 +260,17 @@ public class StackManagerTest {
     assertEquals("2.1.1", stack.getVersion());
     Collection<ServiceInfo> services = stack.getServices();
 
+    ServiceInfo si = stack.getService("SPARK");
+    assertNull(si);
+
+    si = stack.getService("SPARK2");
+    assertNull(si);
+
+    si = stack.getService("SPARK3");
+    assertNotNull(si);
+
     //should include all stacks in hierarchy
-    assertEquals(16, services.size());
+    assertEquals(17, services.size());
     HashSet<String> expectedServices = new HashSet<String>();
     expectedServices.add("GANGLIA");
     expectedServices.add("HBASE");
@@ -258,6 +288,7 @@ public class StackManagerTest {
     expectedServices.add("FAKENAGIOS");
     expectedServices.add("TEZ");
     expectedServices.add("AMBARI_METRICS");
+    expectedServices.add("SPARK3");
 
     ServiceInfo pigService = null;
     for (ServiceInfo service : services) {
@@ -462,7 +493,7 @@ public class StackManagerTest {
   public void testMonitoringServicePropertyInheritance() throws Exception{
     StackInfo stack = stackManager.getStack("HDP", "2.0.8");
     Collection<ServiceInfo> allServices = stack.getServices();
-    assertEquals(13, allServices.size());
+    assertEquals(14, allServices.size());
 
     boolean monitoringServiceFound = false;
 
@@ -483,7 +514,7 @@ public class StackManagerTest {
     StackInfo stack = stackManager.getStack("HDP", "2.0.6");
     Collection<ServiceInfo> allServices = stack.getServices();
 
-    assertEquals(11, allServices.size());
+    assertEquals(12, allServices.size());
     HashSet<String> expectedServices = new HashSet<String>();
     expectedServices.add("GANGLIA");
     expectedServices.add("HBASE");
@@ -493,6 +524,7 @@ public class StackManagerTest {
     expectedServices.add("MAPREDUCE2");
     expectedServices.add("OOZIE");
     expectedServices.add("PIG");
+    expectedServices.add("SPARK");
     expectedServices.add("ZOOKEEPER");
     expectedServices.add("FLUME");
     expectedServices.add("YARN");

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java
index 0b7d0ff..4698178 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java
@@ -120,6 +120,17 @@ public class StackModuleTest {
         ImmutableMultiset.of("bar:2.0.1", "bar:2.0.1"), repoIds);
   }
 
+  @Test
+  public void removedServicesInitialValue () throws Exception {
+    StackModule sm = createStackModule("FooBar",
+        "2.4",
+        Optional.<List<RepositoryInfo>>absent(),
+        Lists.newArrayList(repoInfo("bar", "2.0.1", "http://bar.org", "centos6")),
+        Lists.newArrayList(repoInfo("bar", "2.0.1", "http://bar.org", "centos7")));
+    List<String> removedServices = sm.getModuleInfo().getRemovedServices();
+    assertEquals(removedServices.size(), 0);
+  }
+
   private StackModule createStackModule(String stackName, String stackVersion, Optional<? extends List<RepositoryInfo>> stackRepos,
                                         List<RepositoryInfo>... serviceRepoLists) throws AmbariException {
     StackDirectory sd = mock(StackDirectory.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/resources/stacks/HDP/2.0.6/services/SPARK/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.6/services/SPARK/metainfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.0.6/services/SPARK/metainfo.xml
new file mode 100644
index 0000000..9f1dfab
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.6/services/SPARK/metainfo.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK</name>
+      <comment>Spark</comment>
+      <version>1.5.2.2.3</version>
+      <components>
+        <component>
+          <name>SPARK_CLIENT</name>
+          <category>CLIENT</category>
+        </component>
+      </components>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK/metainfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK/metainfo.xml
new file mode 100644
index 0000000..fca823f
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK/metainfo.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK</name>
+      <comment>Spark</comment>
+      <version>1.5.2.2.3</version>
+      <deleted>true</deleted>
+      <components>
+        <component>
+          <name>SPARK_CLIENT</name>
+          <category>CLIENT</category>
+        </component>
+      </components>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK2/metainfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK2/metainfo.xml
new file mode 100644
index 0000000..7f40c2c
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/SPARK2/metainfo.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK2</name>
+      <comment>Spark2</comment>
+      <version>2.0.0.0</version>
+      <components>
+        <component>
+          <name>SPARK_CLIENT</name>
+          <category>CLIENT</category>
+        </component>
+      </components>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK2/metainfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK2/metainfo.xml
new file mode 100644
index 0000000..7989440
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK2/metainfo.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK2</name>
+      <comment>Spark2</comment>
+      <version>2.0.0.0</version>
+      <deleted>true</deleted>
+      <components>
+        <component>
+          <name>SPARK_CLIENT</name>
+          <category>CLIENT</category>
+        </component>
+      </components>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/162ee83c/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK3/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK3/metainfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK3/metainfo.xml
new file mode 100644
index 0000000..a8d785a
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/SPARK3/metainfo.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK3</name>
+      <comment>Spark3</comment>
+      <version>3.0.0.0</version>
+      <components>
+        <component>
+          <name>SPARK_CLIENT</name>
+          <category>CLIENT</category>
+        </component>
+      </components>
+    </service>
+  </services>
+</metainfo>