3.1 Overview
The composition algorithm is built upon an adjusted
breadth-first search traversal over the set of param-
eters. This starts from the user known parameters,
aiming to obtain the user required parameters. A
loop tries to select the next services to call if any is
available. Learned output parameters are marked as
such in a set, and for each service, all unknown input
parameters are kept in a map. When one such map
becomes empty, the corresponding service becomes
available to call. The loop stops when all user
required parameters are learned. If multiple services
become available at the same time, the one with
the best score is selected. This score approximates
the usefulness of the service and is the length of
the shortest possible distance from the service to
any of the final user required parameters (distance is
calculated in the number of services). When selecting
a service, there is no guarantee that the service will
be useful in the final composition. Therefore, as a
final step, we also execute a composition shortening
algorithm. This shortening algorithm navigates the
services in the reverse order of the composition and
deletes all services that do not output used parameters.
The design of the solution is to return the compo-
sition as soon as constructed to the user in order to
provide a fast response time. To provide the failover
mechanism, the algorithm pre-computes alternative
compositions for each user query. These alternative
compositions are searched in a background thread.
Each backup is stored internally at the time it com-
pletes. If a service fails, the backup is provided to the
user as the new active composition, and immediately
takes an active role instead of the disrupted compo-
sition. Then, similarly, in the background, a new
backup to the new active composition is re-computed,
and the old one is deleted. It is expected that these
backup compositions are computed initially before
any service failure. However, in the other, unlikely
and worst case situation, it is easy to detect that the
composition is broken without having a backup ready
for replacement. If this happens, the composition is
re-built from scratch as for a new query, and the user
will just notice a longer response time.
To compute the alternative backup compositions,
the algorithm prepares for cases in which each (but
only one) service goes down. If more services break
at the same time, the recovery can take longer, as the
solution is to process failed services sequentially.
3.2 Failover Mechanism Details
The response composition for a query is represented
as a simple ordered sequence of services. The order
defines chronological execution of services and is
determined according to how parameters matched
between services. If one of the services fails, it might
be replaceable by other services in the repository. To
find a solution equivalent to the failed service, we
search for a new backup composition. This search is
similar to solving a new user query, and we use again
the same composition search algorithm. However,
we need to prepare new appropriate parameter sets.
This is depicted in Figure 1, where ws
p
breaks. All
the services that are situated before the failed service
provide a set of {known} parameters, which includes
the user’s initially known parameters. These will be
the input parameters of the new query. We prepare
the output parameters targeting to keep in the new
composition the still valid services from the old suffix,
after the failed service. All new required (output)
parameters are collected in the {required} \ {known}
\ {gen} set, where \ is the set difference operator.
The {required} set contains all input parameters of
any service on the right of ws
p
and any initially user
required parameter. It is obvious that we can remove
the {known} parameters out of this new query output
set. Parameters in {gen} are inputs of subsequent
services that are also ”generated” as outputs of other
(previous) services on the right. If we consider the
old suffix after ws
p
still valid and try to keep it, {gen}
parameters are not actually necessary. We can also
remove them from the new required set. The reason
for building the sets in this manner is that the more
parameters are added to the known and the less are
required, the shorter the composition will be.
If no composition is found for the new ( {known}
→ {required} \ {known} \ {gen} ) query, it does not
necessarily mean that no solution exists. There might
be the case that services succeeding ws
p
use some
parameters that are no longer accessible. In such a
situation, all the composition’s suffix, i.e., services on
the right of ws
p
must be reconstructed. This, again,
can be done by a new composition query: ( {known}
→ {user requested} \ {known} ), displayed as the
suffix query in Figure 1.
If this does not succeed either, the user query is no
longer solvable, because only keeping the services on
the left of ws
p
can be at most useless, but not wrong.
Regardless of how the composition was re-
constructed, the algorithm does not maintain the
backups for the ”partial” compositions themselves
(i.e., the ones replacing just ws
p
or the suffix of the
initial composition). Backup solutions are built for
Towards Integrated Failure Recovery for Web Service Composition
579