private static boolean isInheritedExtensionService(StackManager stackManager, StackInfo stack, String serviceName, String extensionName) {
    // Check if service is from an extension at the current stack level, if so then it isn't inherited from its parent stack version
    if (isExtensionService(stack, serviceName, extensionName)) {
      LOG.debug("Service is at requested stack/version level " + serviceName);
      return false;
    }

    return isExtensionService(stackManager, stack.getName(), 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