Chapter 5

Solvability of Colorless Tasks in Different Models

Abstract

This chapter explores the circumstances under which colorless tasks can be solved in different communication models, satisfying different fault-tolerance requirements. We consider both shared memory and message-passing models, wait-free and image-resilient protocols, and protocols that work against adversaries.

Keywords

image-resilient; Adversaries; Layered snapshot protocols; Message-passing protocols; Wait-free

In Chapter 4 we considered colorless layered immediate snapshot protocols and identified the colorless tasks that such protocols can solve while tolerating crash failures by any number of processes. This chapter explores the circumstances under which colorless tasks can be solved using other computational models.

We consider models with different communication mechanisms and different fault-tolerance requirements. We show that the ideas of the previous chapter can be extended to characterize the colorless tasks that can be solved when up to image out of image processes may crash, when the processes communicate by shared objects that solve image-set agreement, or when the processes communicate by message passing.

Once we have established necessary and sufficient conditions for a task to have a protocol in a particular model, it is natural to ask whether it is decidable whether a given task satisfies those conditions. We will see that the answer to that question depends on the model.

5.1 Overview of models

Recall from Chapter 4 that a colorless task is one where only the sets of input or output values matter, not which process has which. For such tasks, an initial configuration remains an initial configuration if one participating process exchanges its own input value for another’s, and the same holds true for final configurations. Consensus and image-set agreement are examples of colorless tasks.

In a model where the processes communicate by layered snapshots and any number of processes can fail by crashing, a protocol must be wait-free. A process cannot wait for another process to take a step, because it cannot tell whether that process has crashed or is merely slow. We have seen that a colorless task image has a wait-free image-process layered immediate snapshot protocol if and only if there is a continuous map

image (5.1.1)

carried by image (Theorem 4.3.1). Informally, this characterization says that wait-free layered snapshot protocols transform (sets of at most image different) inputs to outputs in a continuous way.

In this chapter we consider several other models for which the computational power can be measured by a parameter image. The colorless tasks solvable in a model with parameter image are exactly those for which there is a continuous map

image

carried by image. Thus, the wait-free layered snapshot model is the weakest, having image, whereas a model with image can solve any colorless task.

Sometimes the wait-free condition may be too demanding. Instead of tolerating failures by an arbitrary subset of processes, we may be willing to tolerate fewer failures. A protocol is image-resilient if it tolerates halting failures by as many as image processes. (A wait-free protocol is image-resilient.) We say that a colorless task has a t-resilient protocol in a model if, for all image, there is a image-resilient image-process protocol for that task. In Section 5.2 we will see that a colorless task image has a image-resilient layered snapshot protocol if and only if there is a continuous map

image (5.1.2)

carried by image. Not surprisingly, the image-resilient Condition 5.1.2 is strictly weaker than its wait-free counterpart, Condition 5.1.1, since the map needs to be defined only over the image-skeleton of the input complex. The lower the dimension image, the easier it is to satisfy this condition and the more tasks that can be solved. In a sense, these two conditions capture the cost of fault tolerance. For colorless tasks, solvability is determined by the number of processes that can fail, whereas the total number of processes is irrelevant.

We also show (Section 5.3) that if we augment layered snapshot protocols by also allowing processes to communicate through image-set agreement objects, then a colorless task image has a wait-free layered protocol if and only if there is a continuous map

image

carried by image. Adding image-set agreement objects, image, increases the computational power of layered snapshot protocols by lowering the dimension of the skeleton on which a map must exist.

It follows that fault tolerance and communication power are, in a sense, interchangeable for colorless computability. A image-resilient layered colorless protocol and a wait-free layered protocol augmented by image-set agreement objects, are equivalent: They can solve the same colorless tasks. Notice that in the extreme case, where image, any colorless task is solvable, either because there are no failures or because the processes can reach consensus (Exercise 5.2). More generally, let image be an integer, image. Then, for any image such that image, there is a image-resilient image-set agreement layered snapshot protocol for a task image if and only if there is a continuous map

image

carried by image (see Exercise 5.4).

The previous chapter’s techniques extend even to the case where process failures are not independent. In Section 5.4, we show how to exploit knowledge of which potential failures are correlated and which are not. A parameter image captures the power of such a model for solving colorless tasks. This parameter is the size of the smallest core in the system, a minimal set of processes that will not all fail in any execution. The result for image-resilient solvability readily generalizes to dependent failures. A colorless task image has a layered protocol with minimal core size image if and only if there is a continuous map

image

carried by image.

Next, in Section 5.5 we consider message-passing protocols. The layered snapshot model might appear to be stronger; once a process writes a value to shared memory, that value is there for all to see, whereas a value sent in a message is visible only to the process that received the message. Perhaps surprisingly, as long as a majority of processes is nonfaulty (that is, image), the two models are equivalent: Any task that has a image-resilient layered immediate snapshot protocol has a image-resilient message-passing protocol, and vice versa.

Once we have established necessary and sufficient conditions for a task to have a protocol in a particular model, it is natural to ask whether it is decidable whether a given task satisfies those conditions. We will see in Section 5.6 that the answer depends on the model. Essentially, for any model in which solvable tasks are exactly those for which there is a continuous map

image

carried by image, then solvability is decidable if and only if image.

5.2 t-Resilient layered snapshot protocols

Recall that wait-free protocols tolerate crash failures by all processes but one (that is, image out of image). Sometimes this level of resilience is excessive, especially if there are many processes. Instead, it may be enough to tolerate only image failures among image processes, where image, a property called image-resilience.

A colorless image-resilient layered immediate snapshot protocol (image-resilient layered protocol when clear from context) is structured as shown in Figure 5.1. As in the wait-free case, the processes share a two-dimensional memory array mem[image][i], where row image is shared only by the processes participating in layer image, and column image is written only by image. During layer image writes its current view to mem[image][i], waits for image views (including its own) to be written to that layer’s row, and then takes a snapshot of that row. The waiting step introduces no danger of deadlock because at least image nonfaulty processes will eventually reach each level and write their views.

image

Figure 5.1 image-Resilient layered immediate snapshot protocol: Pseudo-code for image.

Notice that the wait-free layered snapshot protocol of Figure 4.1, where image, is a degenerate form of the image-resilient protocol of Figure 5.1. In the wait-free protocol, once image has written to mem[image][i], it can proceed immediately because image, and one view (its own) has already been written.

Right away we can see that even an image-resilient protocol can solve colorless tasks that cannot be solved by a wait-free protocol (and in a single layer). The pseudo-code in Figure 5.2 solves image-set agreement if at most image processes may fail. In contrast, we know from Theorem 4.3.6 that there is no image-set agreement protocol if image processes can fail when image. More generally, this impossibility holds for any value of image (Theorem 5.2.9), so each additional level of resilience allows us to solve a harder instance of set agreement.

Lemma 5.2.1

There exists a image-resilient layered snapshot protocol for image-set agreement.

Proof

As shown in Figure 5.2, each process writes its input, waits until image inputs have been written, and then chooses the least value read. Because there are at least image nonfaulty processes, the waiting step has no danger of deadlock. Because each process can “miss” values from at most image processes, each value chosen will be among the image least input values, so at most image distinct values can be chosen. image

In Exercise 5.22, we ask you to show that this protocol does not actually require immediate snapshots.

image

Figure 5.2 image-Resilient single-layer snapshot protocol for image-set agreement.

The following lemma will be useful for characterizing the colorless tasks that can be solved, tolerating image failures, by a layered colorless protocol. It is similar to Theorem 4.2.8 for wait-free single-layer colorless immediate snapshot protocol complex, and indeed the proof is similar as well.

By Definition 4.2.2 we can consider the triple image for the protocol of Figure 5.1, where image is the input complex of a task, image is the protocol complex where each simplex is a colorless final configuration, and image is the strict execution carrier map.

Lemma 5.2.2

For any colorless single-layer image-process image-resilient snapshot protocol image, we have image, and the restriction of the execution map image to this skeleton is the composition of the image-skeleton and barycentric subdivision operators.

Proof

Consider all executions of the image-resilient protocol of Figure 5.1 on the input subcomplex image. Assume all processes start with vertices from a simplex image in image. The sets of views assembled by the processes form a chain of faces

image

The inclusion follows because these views are snapshots, and snapshots are atomic: If image assembles face image and image assembles face image, then image, or vice versa.

These chains can have length at most image, because image, so indeed the complex consisting of such simplices is contained in the image-skeleton of the barycentric subdivision image.

Moreover, any simplex in image can be produced by such a chain. Consider an execution where image processes start with input vertices from image and at least one starts with each of the other vertices of image. (There are enough processes because the chain has length at most image.) Suppose all the processes with inputs from image concurrently write to the array and immediately take a snapshot, ending up with views equal to image. Similarly, all processes with input from image write and immediately take a snapshot, and so on.

The complex consisting of such simplices is precisely the barycentric subdivision of the image-skeleton of image. Taking the complex over all possible inputs, we have image contains image, and image is the restriction of imageimage

A simple induction, with Lemma 5.2.2 as the base, yields the following.

Lemma 5.2.3

Any colorless image-layer image-process image-resilient snapshot protocol image is the composition of image single-layer image-resilient protocols, where image, and the restriction of the execution map image to this skeleton is the composition of the barycentric subdivision and image-skeleton operators.

If a protocol solves a colorless task image, then we are free to add a preprocessing step to the protocol, where first the processes agree on at most image of their inputs, where image, using the protocol of Figure 5.2. The following lemma states this formally using the protocol composition Definition 4.2.5.

Lemma 5.2.4

Skeleton Lemma

Assume that for any input complex image there is an image-process protocol, image, that solves the image-set agreement task image for some fixed image.

Assume furthermore that the protocol image solves the colorless task image with decision map image. Then the composition of the image-set agreement task with the protocol image also solves image using the same decision map image.

Proof

Recall that by Definition 4.2.5 the task image can be composed with the protocol image, since image. The result of the composition is a new protocol image, where image.

We check that image is a correct decision map for the task. Pick an arbitrary image. We have

image

where the last inclusion is a corollary of the fact that the protocol image solves the task image. It follows that image is a decision map for the composite protocol. image

We may now combine the previous results to show that, for image-resilient colorless task solvability, we may assume without loss of generality that a protocol complex is a barycentric subdivision of the image-skeleton of the input complex.

Lemma 5.2.5

If there is a image-resilient layered protocol that solves the colorless task image, then there is a image-resilient layered protocol image solving that task whose protocol complex image is image, and

image

Proof

By Lemma 5.2.1, there exists a image-resilient layered snapshot protocol for image-set agreement. By the Skeleton Lemma (5.2.4), we can assume without loss of generality that any image-resilient colorless protocol’s input complex is image. Starting on a simplex image in image, after the first layer each process’s view is a vertex of image, and all their views form a simplex of image. After image layers, their views form a simplex of image. It follows that image.

The other direction follows from Lemma 5.2.3. It follows that imageimage

Corollary 5.2.6

For any input complex image, and image, there is an image-process image-resilient layered protocol that solves the barycentric agreement task image.

Theorem 5.2.7

The colorless task image has a image-resilient layered snapshot protocol if and only if there is a continuous map

image (5.2.1)

carried by image.

Proof

By Lemma 5.2.5, for any image-resilient layered snapshot protocol image we may assume the protocol complex image is image. Because layered snapshot protocols solve any barycentric agreement task, we can apply the Protocol Complex Lemma (4.2.6), which states that the protocol solves the task if and only if there is a continuous map

image

carried by image. The claim follows because imageimage

Applying the Discrete Protocol Complex Lemma (4.2.7),

Corollary 5.2.8

The colorless task image has a image-resilient layered snapshot protocol if and only if there is a subdivision image of image and a simplicial map

image

carried by image.

Without loss of generality, we can assume that any image-resilient layered protocol consists of one image-set agreement layer followed by any number of immediate snapshot layers. Moreover, only the first image-set agreements layer requires waiting; the remaining layers can be wait-free.

Theorem 5.2.9

There is no image-resilient layered snapshot protocol for image-set agreement.

Proof

See Exercise 5.3image

An important special case of the previous theorem occurs when image, implying that consensus is not solvable by a layered protocol even if only a single process can fail.

5.3 Layered snapshots with k-set agreement

Practically all modern multiprocessor architectures provide synchronization primitives more powerful than simple read or write instructions. For example, the test-and-set instruction atomically swaps the value true for the contents of a memory location. If we augment layered snapshots with test-and-set, for example, it is possible to solve wait-free image-set agreements for image (see Exercise 5.5). In this section, we consider protocols constructed by composing layered snapshot protocols with image-set agreement protocols.

In more detail, we consider protocols in the form of Figure 5.3. The protocol is similar to the colorless wait-free snapshot protocol of Figure 4.1 except that in addition to sharing memory, the objects share an array of image-set agreement objects (Line 3). In each layer image, the processes first join in a image-set agreement protocol with the other processes in that layer (Line 8), and then they run an image-layer immediate snapshot protocol (Line 11) for some image.

image

Figure 5.3 Colorless layered set agreement protocol: Pseudo-code for image.

Recall that the image-set agreement protocol with input complex image is image, where the skeleton operator is considered as a strict carrier map (see Exercise 4.8).

Recall also that if image and image are protocols where the protocol complex for the first is contained in the input complex for the second, then their composition is the protocol image, where image (Definition 4.2.3).

Definition 5.3.1

A image-set layered snapshot protocol is one composed from layered snapshot and image-set agreement protocols.

Lemma 5.3.2

Without loss of generality, we can assume the that the first protocol in any such composition is a image-set agreement protocol. (That is, image.)

Proof

This claim follows directly from the Skeleton Lemma (5.2.4)image

Lemma 5.3.3

If image is a image-set layered snapshot protocol, then image is equal to image for some image.

Proof

We argue by induction on image, the number of image-set and layered snapshot protocols composed to construct image. For the base case, when image, the protocol is just a image-set agreement protocol by Lemma 5.3.2, so the protocol complex image is just image.

For the induction step, assume that image is the composition of image and image, where the first protocol is the result of composing image image-set or layered snapshot protocols, and image. By the induction hypothesis, image is image for some image.

There are two cases. First, if image is a image-set protocol, then

image

Second, if it is an image-layer snapshot protocol, then

image

 image

Theorem 5.3.4

The colorless task image has a image-set layered snapshot protocol if and only if there is a continuous map

image (5.3.1)

carried by image.

Proof

By Lemma 5.2.5, any image-set layered snapshot protocol image has image. By the Protocol Complex Lemma (4.2.6), the protocol solves the task if and only if there is a continuous map

image

carried by image. The claim follows because imageimage

Applying the Discrete Protocol Complex Lemma (4.2.7):

Corollary 5.3.5

The colorless task image has a image-set layered snapshot protocol if and only if there is a subdivision image of image and a simplicial map

image

carried by image.

Theorem 5.3.6

There is no image-set layered snapshot protocol for image-set agreement.

Proof

See Exercise 5.7image

The next corollary follows because Theorem 5.3.4 is independent of the order in which image-set agreement layers are composed with immediate snapshot layers.

Corollary 5.3.7

We can assume without loss of generality that any set agreement protocol consists of a single image-set agreement layer followed by some number of layered immediate snapshot protocols.

5.4 Adversaries

A image-resilient protocol is designed under the assumption that failures are uniform: Any image out of image processes can fail. Often, however, failures are correlated. In a distributed system, processes running on the same node, in the same network partition, or managed by the same provider may be more likely to fail together. In a multiprocessor, processes running on the same core, on the same processor, or on the same card may be likely to fail together. It is often possible to design more effective fault-tolerant algorithms if we can exploit knowledge of which potential failures are correlated and which are not.

One way to think about such failure models is to assume that failures are controlled by an adversary who can cause certain subsets of processes to fail, but not others. There are several ways to characterize adversaries. The most straightforward is to enumerate the faulty sets: all sets of processes that fail in some execution. We will assume that faulty sets are closed under inclusion; if image is a maximal set of processes that fail in some execution, then for any image there is an execution in which image is the actual set of processes that fail. There is a common-sense justification for this assumption: We want to respect the principle that fault-tolerant algorithms should continue to be correct if run in systems that display fewer failures than in the worst-case scenario. A model that permits algorithms that are correct only if certain failures occur is unlikely to be useful in practice.

Faulty sets can be described as a simplicial complex image, called the faulty set complex, the vertices of which are process names and the simplices of which are sets of process names such that exactly those processes fail in some execution.

Faulty sets can be cumbersome, so we use a more succinct and flexible way to characterize adversaries. A core is a minimal set of processes that will not all fail in any execution. A core is a simplex that is not itself in the faulty set complex, but all of its proper faces are in image. The following dual notion is also useful. A survivor set is a minimal set of processes that intersects every core (such a set is sometimes called a hitting set). In every execution, the set of nonfaulty processes includes a survivor set.

Here are some examples of cores and survivor sets.

The Wait-Free Adversary. The entire set of processes is the only core, and the singleton sets are the survivor sets.

The image -Faulty Adversary. The cores are the sets of cardinality image, and the survivor sets are the sets of cardinality image.

An Irregular Adversary. Consider a system of four processes, image, image, and image, where any individual process may fail, or image and image may both fail. Here image is a core, since they cannot both fail, yet there is an execution in which each one fails. In all, there are five cores:

image

and three survivor sets:

image

The set image is a survivor set, since there is an execution where only these processes are nonfaulty. This adversary is illustrated in Figure 5.4.

image

Figure 5.4 An irregular adversary: image, and image can each fail individually, or image and image may both fail. The faulty set complex consists of an edge linking image and image, shown as a solid line, and two isolated vertices, image and image. There are five cores, shown as dotted lines.

Here is how to use cores and survivor sets in designing a protocol. Given a fixed core image, it is safe for a process to wait until it hears from some member of image, because they cannot all fail. It is also safe for a process to wait until it hears from all members of some survivor set, because the set of nonfaulty processes always contains a survivor set. See Exercise 5.14.

Let image be an adversary with minimum core size image. We say that a protocol is image-resilient if it tolerates any failure permitted by image. As illustrated in Figure 5.5, an image-resilient layered snapshot protocol differs from a image-resilient protocol as follows. At each layer, after writing its own value, each process waits until all the processes in a survivor set (possibly including itself) have written their views to that layer’s memory. As noted, there is no danger of deadlock waiting until a survivor set has written.

image

Figure 5.5 image-resilient layered snapshot protocol: Pseudo-code for image.

image

Figure 5.6 image-resilient layered snapshot protocol for image-set agreement.

Notice that the image-resilient layered snapshot protocol of Figure 5.1 is a degenerate form of the image-resilient protocol of Figure 5.5 because, for the image-resilient protocol, any set of image processes is a survivor set.

Lemma 5.4.1

Let image be an adversary with minimum core size image. There is an image-resilient layered snapshot protocol for image-set agreement.

Proof

It is a little easier to explain this protocol using writes and snapshots instead of immediate snapshots (see Exercise 5.23). Pick a core image of image of minimal size image. Figure 5.6 shows a single-layer protocol. Each process image in image writes its input to mem[0][i], while each process not in image repeatedly takes snapshots until it sees a value written (by a process in image). It then replaces its own input value with the value it found. At most image distinct values can be chosen. This protocol must terminate because image is a core, and the adversary cannot fail every process in imageimage

Lemma 5.4.2

Without loss of generality, for any image-layer image-resilient colorless protocol image,

image

Proof

By Lemma 5.4.1, there exists an image-resilient layered snapshot protocol for image-set agreement. By the Skeleton Lemma (5.2.4), we can assume without loss of generality that any image-resilient colorless protocol’s input complex is image. From that point on the rest of the proof is virtually identical to the proof of Lemma 5.2.5image

Theorem 5.4.3

The colorless task image has an image-resilient layered snapshot protocol if and only if there is a continuous map

image (5.4.1)

carried by image.

Proof

By Lemma 5.4.2, any image-resilient layered snapshot protocol image has image. The Protocol Complex Lemma (4.2.6) states that the protocol solves the task if and only if there is a continuous

image

carried by image. The claim follows because imageimage

Applying the Discrete Protocol Complex Lemma (4.2.7):

Corollary 5.4.4

The colorless task image has an image-resilient layered snapshot protocol if and only if there is a subdivision image of image and a simplicial map

image

carried by image.

Theorem 5.4.5

There is no image-resilient image-set agreement layered snapshot protocol.

Proof

See Exercise 5.15image

5.5 Message-passing protocols

So far we have focused on models in which processes communicate through shared memory. We now turn our attention to another common model of distributed computing, where processes communicate by message passing.

There are image asynchronous processes that communicate by sending and receiving messages via a communication network. The network is fully connected; any process can send a message to any other. Message delivery is reliable; every message sent is delivered exactly once to its target process after a finite but potentially unbounded delay. Message delivery is first-in, first-out (FIFO); messages are delivered in the order in which they were sent.

The operational model is essentially unchanged from the layered snapshot model. The principal difference is that communication is now one-to-one rather than one-to-many. In Exercise 5.11, we ask you to show that barycentric agreement is impossible in a message-passing model if a majority of the process can fail. For this reason, we restrict our attention to image-resilient protocols where image, the number of processes that can fail, is less than half: image.

We will see that as long as a majority of processes are nonfaulty, there is a image-resilient message-passing protocol if and only if there is a image-resilient layered snapshot protocol. We will see, however, that message-passing protocols look quite different from their shared-memory counterparts.

For shared-memory protocols, we focused on layered protocols because it is convenient to have a “clean” shared memory for each layer. For message-passing protocols, where there is no shared memory, we will not need to use layered protocols. Later, in Chapter 13, it will be convenient impose a layered structure on asynchronous message-passing executions.

In our examples we use the following notation. A process image sends a message containing values image to image as follows:

sendimage to image

We say that a process broadcasts a message if it sends that message to all processes, including itself:

sendimage to all

Here is how image receives a message from image:

upon receive image do

 …  // do something with the values received

Some message-passing protocols require that each time a process receives a message from another, the receiver forwards that message to all processes. Each process must continue to forward messages even after it has chosen its output value. Without such a guarantee, a nonfaulty process that chooses an output and falls silent is indistinguishable from a crashed process, implying that tasks requiring a majority of processes to be nonfaulty become impossible. We think of this continual forwarding as a kind of operating system service running in the background, interleaved with steps of the protocol itself. In our examples, such loops are marked with the background keyword:

background // forward messages forever

 upon receive image do

  send image to all

We start with two useful protocols, one for image-set agreement and one for barycentric agreement.

5.5.1 Set agreement

As a first step, each process assembles values from as many other processes as possible. The getQuorum() method shown in Figure 5.7 collects values until it has received messages from all but image processes. It is safe to wait for that many messages because there are at least image nonfaulty processes. It is not safe to wait for more, because the remaining image processes may have crashed.

image

Figure 5.7 Return values from at least image processes.

Figure 5.8 shows a simple protocol for image-set agreement. Each process broadcasts its input value, waits to receive values from a quorum of image messages, and chooses the least value among them. A proof of this protocol’s correctness is left as Exercise 5.9. Note that this protocol works for any value of image.

image

Figure 5.8 image-resilient message-passing protocol for image-set agreement.

5.5.2 Barycentric agreement

Recall that in the barycentric agreement task, each process image is assigned as input a vertex image of a simplex image, and after exchanging messages with the others, chooses a face image containing image, such that for any two participating processes image and image the faces they choose are ordered by inclusion: image, or vice versa. This task is essentially equivalent to an immediate snapshot, which it is convenient (but not necessary) to assume as a shared-memory primitive operation. In message-passing models, however, we assume send and receive as primitives, and we must build barycentric agreement from them.

Figure 5.9 shows a message-passing protocol for barycentric agreement. Each image maintains a set image of messages it has received, initially only image’s input value (Line 2). image repeatedly broadcasts image, and waits to receive sets from other processes. If it receives image such that image (Line 7), then it increments its count of the number of times it has received image. If it receives image such that image (Line 9). It sets image to image and starts over. When image has received image identical copies of image from distinct processes, the protocol terminates, and image decides image. As usual, after the protocol terminates, image must continue to forward messages to the others (Lines 15–17).

Lemma 5.5.1

The protocol in Figure 5.9 terminates.

Proof

Suppose, by way of contradiction, that image runs this protocol forever. Because image changes image at most image times, there is some time at which image’s image assumes its final value image. For every set image that image received earlier, image, and for every image received later, image.

When image updates image to image, it broadcasts image to the others. Suppose a nonfaulty image receives image from image, where image. image must have sent image to image when it first set image to image. Since image henceforth does not change image, either image, or image. If image, then image will send image back to image, increasing its count. If image, then image already sent image to image. Either way, image receives a copy of image from at least image nonfaulty processes and terminates the protocol. image

Lemma 5.5.2

In the protocol in Figure 5.9 , if image decides image and image decides image, then either image, or vice versa.

Proof

Note that the sequence of sets image broadcast by any process is strictly increasing: image. To decide, image received image from a set image of at least image processes, and image received image from a set image at least image processes. Because image cannot exceed image, image and image must both contain a process image that sent both image and image, implying they are ordered, a contradiction. image

image

Figure 5.9 Barycentric agreement message-passing protocol.

5.5.3 Solvability condition

We can now characterize which tasks have protocols in the image-resilient message-passing model.

Theorem 5.5.3

For image, image has a image-resilient message-passing protocol if and only if there is a continuous map

image

carried by image,

Proof

Protocol Implies Map

If a task has an image-process image-resilient message-passing protocol, then it has an image-process image-resilient layered snapshot protocol (see Exercise 5.10). The claim then follows from Theorem 5.2.7.

Map Implies Protocol. The map

image

has a simplicial approximation,

image

also carried by image. We construct a two-step protocol. In the first step, the processes use the image-set agreement protocol of Figure 5.8 to converge to a simplex image in image, In the second step, they repeat the barycentric agreement protocol of Figure 5.9 to converge to a simplex in image. Composing these protocols and using image as a decision map yields the desired protocol. image

Theorem 5.5.4

For image has a image-resilient message-passing protocol if and only if there is a subdivision image of image and a simplicial map

image

carried by image.

Proof

See Exercise 5.16image

Theorem 5.5.5

There is no image-resilient message-passing protocol for image-set agreement.

Proof

See Exercise 5.17image

5.6 Decidability

This section uses more advanced mathematical techniques than the earlier sections.

Now that we have necessary and sufficient conditions for a task to have a protocol in various models, it is natural to ask whether we can automate the process of deciding whether a given task has a protocol in a particular model. Can we write a program (that is, a Turing machine) that takes a task description as input and returns a Boolean value indicating whether a protocol exists?

Not surprisingly, the answer depends on the model of computation. For wait-free layered snapshot protocols or wait-free image-set layered snapshot protocols for image, the answer is no: There exists a family of tasks for which it is undecidable whether a protocol exists. We will construct one such family: the loop agreement tasks, discussed in Chapter 15. On the other hand, for wait-free image-set layered snapshot protocols for image or 2, the answer is yes: For every task, it is decidable whether a protocol exists. For any model where the solvability question depends only on the 1-skeleton of the input complex, solvability is decidable (see Exercise 5.19).

5.6.1 Paths and loops

Let image be a finite 2-dimensional complex. Recall from Chapter 3 that an edge path between vertices image and image in image is a sequence of vertices image such that each pair image is an edge of image for image. A path is simple if the vertices are distinct.

Definition 5.6.1

An edge path is an edge loop if its first and last vertices are the same. An edge loop is simple if all the other vertices are distinct. An edge loop’s first vertex is called its base point.

All edge loops considered here are assumed to be simple.

Informally, we would like to distinguish between edge loops that circumscribe “solid regions” and edge loops that circumscribe holes. To make this notion precise, we must introduce some continuous concepts.

Definition 5.6.2

Fix a point image on the unit circle image. A continuous loop in image with base point image is a continuous map image such that image. A continuous loop image is simple if it has no self-intersections: image only if image.

All continuous loops considered here are assumed to be simple.

As illustrated in Figure 5.10, a continuous loop in image is contractible if it can be continuously deformed to its base point in finite “time,” leaving the base point fixed. Formally, we capture this notion as follows.

Definition 5.6.3

A continuous loop image in image is contractible if it can be extended to a continuous map image, where image denotes the image-disk for which the boundary is the circle image, the input domain for image.

image

Figure 5.10 Noncontractible (left) and contractible (right) continuous loops.

A simple continuous loop image is a representative of a simple edge loop image if their geometric images are the same: image.

Definition 5.6.4

A simple edge loop image is contractible if it has a contractible representative.

Although any particular simple edge loop has an infinite number of representatives, it does not matter which one we pick.

Fact 5.6.5

Either all of an edge loop’s representatives are contractible, or none are.

In Exercise 5.18, we ask you to construct an explicit representative of an edge path.

Fact 5.6.6

The question whether an arbitrary simple edge loop in an arbitrary finite simplicial complex is contractible is undecidable.

Remarkably, the question remains undecidable even for complexes of dimension two (see Section 5.7, “Chapter notes”).

Mathematical Note 5.6.7

The notion of contractibility is a special case of a more general notion called loop homotopy. Given two continuous loops with the same base point, we would like to treat them as equivalent if one loop can be continuously deformed to the other in finite “time,” leaving their common base point fixed. Formally, two loops image with common base point image are homotopic if there is a continuous map image, such that image, for all image. If we think of the second coordinate in image as time, then image is image is image, and image is the intermediate loop at time image, for image. Note that the base point does not move during the deformation.

The trivial loop never leaves its base point. It is given by image, where image for all image. It is a standard fact that a loop is contractible if and only if it is homotopic to the trivial loop at its base point.

The homotopy classes of loops for a topological space image are used to define that space’s fundamental group, usually denoted image. These groups are extensively studied in algebraic topology.

5.6.2 Loop agreement

Let image denote the image-simplex for which the vertices are labeled image, and image, and let image denote an arbitrary image-dimensional complex. We are given three distinct vertices image, and image in image, along with three edge paths image, and image, such that each path image goes from image to image. We let image denote the corresponding image-dimensional simplicial subcomplex as well, in which case we let image. We assume that the paths are chosen to be nonself-intersecting and that they intersect each other only at corresponding end vertices.

Definition 5.6.8

These edge paths image, and image form a simple edge loop image with base point image, which we call a triangle loop, denoted by the image-tuple image.

In the loop agreement task, the processes start on vertices of image and converge on a simplex in image, subject to the following conditions. If all processes start on a single vertex image, they converge on the corresponding vertex image. If they start on two distinct input vertices, image and image, they converge on some simplex (vertex or edge) along the path image linking image and image. Finally, if the processes start on all three input vertices image, they converge to some simplex (vertex, edge, or triangle) of image. See Figure 5.11 for an illustration. More precisely:

Definition 5.6.9

The loop agreement task associated with a triangle loop image in a simplicial complex image is a triple image, where the carrier map image is given by

image

Since the loop agreement task is completely determined by the complex image and the triangle loop image, we also denote it by image.

image

Figure 5.11 Loop agreement.

5.6.3 Examples of loop agreement tasks

Here are some examples of interesting loop agreement tasks:

• A image-set agreement task can be formulated as the loop agreement task image, where image.

• Let image be an arbitrary subdivision of image. In the image-dimensional simplex agreement task, each process starts with a vertex in image. If image is the face composed of the starting vertices, then the processes converge on a simplex in image. This task is the loop agreement task image, where image, with image denoting the unique simple edge path from image to image in the subdivision of the edge image.

• The image-dimensional image-th barycentric simplex agreement task is simplex agreement for image, the image-th iterated barycentric subdivision of image. Notice that image-barycentric agreement is just the trivial loop agreement task image, where image, since a process with input image can directly decide image.

• In the image-dimensional image-agreement task, input values are vertices of a face image of image, and output values are points of image that lie within image of one another in the convex hull of the input values. This task can be solved by a protocol for image-barycentric simplex agreement for suitably large image.

• In the image-dimensional approximate agreement task input values are taken from the set image, and output values are real numbers that lie within image of one another in the convex hull of the input values. This task can be solved by a image-dimensional image-agreement protocol.

Of course, not all tasks can be cast as loop agreement tasks.

5.6.4 Decidability for layered snapshot protocols

We now show that a loop agreement task image has layered snapshot protocol for image if and only if the triangle loop image is contractible in image. Loop contractibility, however, is undecidable, and therefore so is the question whether an arbitrary loop agreement task has a protocol in this model.

We will need the following standard fact.

Fact 5.6.10

There is a homeomorphism from the 2-disk image to image,

image

that carries boundary to boundary: image.

Theorem 5.6.11

For image, the loop agreement task image has a image-resilient layered snapshot protocol if and only if the triangle loop image is contractible.

Proof

Note that because image has dimension 2, image for image.

Protocol Implies Contractible. By Theorem 4.3.1, if the task image has a wait-free layered snapshot protocol, then there exists a continuous map image carried by image. Because image is carried by image, image satisfies image, for image, and image, for image. Composing with the homeomorphism image of Fact 5.6.10, we see that the map image, restricted to the 1-sphere image, is a simple continuous loop image. Moreover, this continuous loop is a representative of image. Since the map image can be extended to all of image, it is contractible, and so is the triangle loop image.

Contractible Implies Protocol. Let image be the homeomorphism of Fact 5.6.10.

The edge map image induces a continuous map

image

carried by image: image for image, and image for image. The composition of image followed by image is a simple loop:

image

also carried by image. Because image is contractible, Fact 5.6.5 implies that image can be extended to

image

also carried by image. It is easy to check that the composition

image

is also carried by image. Theorem 5.2.7 implies that there is a image-resilient layered snapshot protocol for this loop agreement task. image

Corollary 5.6.12

It is undecidable whether a loop agreement task has a image-resilient layered snapshot protocol for image.

5.6.5 Decidability with k-set agreement

Essentially the same argument shows that the existence of a wait-free loop agreement protocol is also undecidable for image-set layered snapshot protocols for image.

Corollary 5.6.13

A loop agreement task image has a wait-free image-set layered snapshot protocol for image if and only if the triangle loop image is contractible.

It follows from Fact 5.6.6 that it is undecidable whether a loop agreement task has a protocol for three processes in this model.

The situation is different in models capable of solving 1-set or 2-set agreement, such as 1-resilient layered snapshot or message-passing protocols, or wait-free image-set layered snapshot protocols for image or 2.

Theorem 5.6.14

In any model capable of solving image-set agreement for image, it is decidable whether a task has a protocol.

Proof

In each of these models, a task image has a protocol if and only if there exists a continuous map image carried by image.

When image, this map exists if and only if image is nonempty for each image, which is certainly decidable. When image, this map exists if and only if, in addition to the nonemptiness condition, for every pair of vertices image in image there is a path from a vertex of image to a vertex of image contained in image. This graph-theoretic question is decidable. image

5.7 Chapter notes

The layered approach used in this chapter was employed by Herlihy, Rajsbaum, and Tuttle [88,89] for message-passing systems. It was used to prove that connectivity is conserved across layers, something we will do later on. In this chapter we used the more direct approach of showing that subdivisions are created in each layer. Earlier work by Herlihy and Rajsbaum [79] and Herlihy and Shavit [91] was based on the “critical state” approach, a style of argument by contradiction pioneered by Fischer, Lynch, and Paterson [55]. This last paper proved that consensus is not solvable in a message-passing system, even if only one process may fail by crashing, a special case of Theorem 5.5.5. Our message-passing impossibility result is simplified by using layering.

In shared-memory systems the wait-free layered approach used in this chapter was introduced as an “iterated model” of computation by Borowsky and Gafni [26]; see the survey by Rajsbaum [128] for additional references. Algorithms in this model can be presented in a recursive form as described by Gafni and Rajsbaum [68] and in the tutorial by Herlihy, Rajsbaum, and Raynal [87]. Fault-tolerant versions of the model were studied by Rajsbaum, Raynal, and Travers [132]. In Chapter 14 we study the relationship of this model with a more standard model in which processes can write and read the same shared array any number of times.

The BG-simulation [27] provides a way to transform colorless tasks wait-free impossibilities bounds to image-resilient impossibilities. As we shall see in Chapter 7, the image-resilient impossibility theorems proved directly in this chapter can be obtained by reduction to the wait-free case using this simulation. The BG simulation and layered models are discussed by Rajsbaum and Raynal [129]. Lubitch and Moran [111] provide a direct model-independent image-resilient impossibility proof of consensus.

Early applications of Sperner’s lemma to set agreement are due to Chaudhuri [38] and to Chaudhuri, Herlihy, Lynch, and Tuttle [40]. Herlihy and Rajsbaum [79] present critical state arguments to prove results about the solvability of set agreement using set agreement objects. We explore in Chapter 9 why renaming is weaker than image-set agreement, as shown by Gafni, Rajsbaum, and Herlihy [69].

Junqueira and Marzullo [99,98] introduced the core/survivor-set formalism for characterizing general adversaries used here, and they derived the first lower bounds for synchronous consensus against such an adversary. Delporte-Gallet et al. [46] investigate the computational power of more general adversaries in asynchronous shared memory using simulation. By contrast, the analogous impossibility results proved here use direct combinatorial arguments. The colorless task solvability characterization theorem for adversaries was proved by Herlihy and Rajsbaum [84] (and extended in [86], as discussed in Chapter 13).

Biran, Moran, and Zaks [19] showed that task solvability is decidable in a message-passing system where at most one process can fail by crashing, providing a characterization of solvable tasks in terms of graph connectivity, extending earlier work by Moran and Wolfstahl [118]. They further present a setting where the decision problem is NP-hard [20]. Gafni and Koutsoupias [63] were the first to note that three-process tasks are undecidable for wait-free layered snapshot protocols. This observation was generalized to other models by Herlihy and Rajsbaum [80].

The message-passing barycentric agreement protocol of Figure 5.9 is adapted from the stable vectors algorithm of Attiya et al. [9]. Attiya et al. [8] showed that it is possible to simulate shared memory using message-passing when a majority of processes are nonfaulty. One could use this simulation to show that our message-passing characterization follows from the shared-memory characterization.

The hierarchy of loop agreement tasks defined by Herlihy and Rajsbaum [83] will be presented in Chapter 15. Several variants and extensions have been studied. Degenerate loop agreement was defined in terms of two vertices of the output complex instead of three, by Liu, Pu, and Pan [108]. More general rendezvous task were studied by Liu, Xu, and Pan [109]. Similar techniques were used by Fraigniaud, Rajsbaum, and Travers [59] to derive hierarchies of tasks motivated by checkability issues.

Contractibility is undecidable because it reduces to the word problem for finitely presented groups: whether an expression reduces to the unit element. This problem was shown to be undecidable by S. P. Novikov [126] in 1955, and the isomorphism problem (whether two such groups are isomorphic) was shown to be undecidable by M. O. Rabin [127] in 1958. (For a more complete discussion of these problems, see Stillwell [142] or Sergeraert [140].)

Biran, Moran, and Zaks [21] study the round complexity of tasks in a message-passing system where at most one process can fail by crashing. Hoest and Shavit [94] consider nonuniform layered snapshot subdivisions to study the number of layers needed to solve a task in the wait-free case (see Exercise 5.21 about the complexity of solving colorless tasks).

image

Figure 5.12 Layered barycentric agreement message-passing protocol.

5.8 Exercises

Exercise 5.1

Show that the colorless complex corresponding to independently assigning values from a set image to a set of image processes is the image-skeleton of a image-dimensional simplex. Thus, it is homeomorphic to the image-skeleton of a image-disk.

Exercise 5.2

Show that any colorless task image such that image is nonempty for every input vertex image is solvable by a image-resilient layered snapshot colorless protocol and by a wait-free layered snapshot colorless protocol augmented with consensus objects.

Exercise 5.3

Prove Theorem 5.2.9: There is no image-resilient layered snapshot protocol for image-set agreement.

Exercise 5.4

Use the techniques of this chapter to show that there is a image-resilient image-set agreement layered snapshot protocol for a task image if and only if there is a continuous map

image

carried by image.

Exercise 5.5

Recall that the test-and-set atomically swaps 1 into a memory location and returns that location’s prior value. Give an image-process protocol for solving image-set agreement using layered snapshots and test-and-set instructions.

Exercise 5.6

Suppose we are given a “black box” object that solves image-set agreement for image processes. Give a wait-free image-process layered snapshot protocol for image-set agreement, where

image

Exercise 5.7

Prove Theorem 5.3.6: There is no image-set layered snapshot protocol for image-set agreement.

Exercise 5.8

Consider a model where message delivery is reliable, but the same message can be delivered more than once, and messages may be delivered out of order. Explain why that model is or is not equivalent to the one we use.

Exercise 5.9

Prove that the set agreement protocol of Figure 5.8 is correct.

Exercise 5.10

Show how to transform any image-resilient message-passing protocol into a image-resilient layered snapshot protocol, even when image.

Exercise 5.11

Show that barycentric agreement is impossible if a majority of the processes can fail: image. (Hint: A partition occurs when two disjoint sets of nonfaulty processes both complete their protocols without communicating.)

Exercise 5.12

Show that a barycentric agreement protocol is impossible if a process stops forwarding messages when it chooses an output value.

Exercise 5.13

Prove Theorem 5.5.5: There is no wait-free message-passing protocol for image-set agreement. (Hint: Use Sperner’s Lemma.)

Exercise 5.14

Explain how to transform the set of cores of an adversary into the set of survivor sets, and vice versa. (Hint: Use disjunctive and conjunctive normal forms of Boolean logic.)

Exercise 5.15

Prove Theorem 5.4.5: There is no image-resilient image-set agreement layered snapshot protocol.

Exercise 5.16

Prove Theorem 5.5.4: For image, image has a image-resilient message-passing protocol if and only if there is a subdivision image of image and a simplicial map

image

carried by image.

Exercise 5.17

Prove Theorem 5.5.5: There is no image-resilient message-passing protocol for image-set agreement.

Exercise 5.18

Construct a loop image that corresponds to the edge loop given by image, image, where image. (Hint: Start by dividing the circle into image equal parts.)

Exercise 5.19

Consider a model of computation where a colorless task image has a protocol image if and only if there is a continuous map

image (5.8.1)

carried by image. Prove that it is decidable whether a protocol exists for a colorless task in this model.

Exercise 5.20

Consider a model of computation where a colorless task image has a protocol image if and only if there is a continuous map

image (5.8.2)

carried by image. Prove that every loop agreement task is solvable in this model.

Exercise 5.21

Show that for any image, and image, there is a loop agreement task such that any image-process image-resilient snapshot protocol that solves it, requires more than image layers. In more detail, suppose the number of edges in each path image of the triangle loop image of the task is image. Then any image-resilient snapshot protocol that solves it requires at least image layers. (Hint: Use Lemma 5.2.3.)

Exercise 5.22

Show that the image-resilient single-layer snapshot protocol for image-set agreement protocol of Figure 5.2 still works if we replace the immediate snapshot with a nonatomic scan, reading the layer’s memory one word at a time.

Exercise 5.23

Rewrite the protocol of Figure 5.6 to use immediate snapshots.

Exercise 5.24

As noted, because message-passing protocols do not use shared memory, there is less motivation to use layered protocol. Figure 5.12 shows a layered message-passing barycentric agreement protocol. Is it correct?

Exercise 5.25

In the adversarial model, suppose we drop the requirement that faulty sets be closed under inclusion. Show that without this requirement, that if all and only sets of image out of image processes are faulty sets, then it is possible to solve consensus.

Exercise 5.26

Let image be a faulty set complex with vertices image. Show that a set of process names image is a survivor set of image if and only if image is a facet of image.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset