private static boolean isExtensionService(StackManager stackManager, String stackName, String stackVersion, String serviceName, String extensionName) {
    LOG.debug("Checking at stack/version " + stackName + "/" + stackVersion);
    StackInfo stack = stackManager.getStack(stackName, stackVersion);

    if (stack == null) {
      LOG.warn("Stack/version not found " + stackName + "/" + stackVersion);
      return false;
    }

    if (isExtensionService(stack, serviceName, extensionName)) {
      LOG.debug("Stack/version " + stackName + "/" + stackVersion + " contains service " + serviceName);
      return true;
    }
    else {
      return isExtensionService(stackManager, stackName, stack.getParentStackVersion(), serviceName, extensionName);
    }
  }
An extension version is like a stack version but it contains custom services.  Linking an extension
version to the current stack version allows the cluster to install the custom services contained in
the extension version.
ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java