On Data Recovery in Distributed Databases



Similar documents
SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

Applied Algorithm Design Lecture 5

Determination of the normalization level of database schemas through equivalence classes of attributes

Mathematics Course 111: Algebra I Part IV: Vector Spaces

About the inverse football pool problem for 9 games 1

Approximation Algorithms

Introduction to Logic in Computer Science: Autumn 2006

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

Every tree contains a large induced subgraph with all degrees odd

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

arxiv: v1 [math.pr] 5 Dec 2011

International Journal of Information Technology, Modeling and Computing (IJITMC) Vol.1, No.3,August 2013

Large induced subgraphs with all degrees odd

Fairness in Routing and Load Balancing

CONTRIBUTIONS TO ZERO SUM PROBLEMS

Network File Storage with Graceful Performance Degradation

Research Article Stability Analysis for Higher-Order Adjacent Derivative in Parametrized Vector Optimization

COUNTING INDEPENDENT SETS IN SOME CLASSES OF (ALMOST) REGULAR GRAPHS

1 VECTOR SPACES AND SUBSPACES

A simple criterion on degree sequences of graphs

On the Relationship between Classes P and NP

On the representability of the bi-uniform matroid

Discrete Applied Mathematics. The firefighter problem with more than one firefighter on trees

Sum of squares of degrees in a graph

The chromatic spectrum of mixed hypergraphs

On the k-path cover problem for cacti

Linear Codes. Chapter Basics

Two classes of ternary codes and their weight distributions

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

Notes on Factoring. MA 206 Kurt Bryan

Weakly Secure Network Coding

ON THE COMPLEXITY OF THE GAME OF SET.

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Math 55: Discrete Mathematics

A Practical Scheme for Wireless Network Operation

Offline sorting buffers on Line

1 Approximating Set Cover

A Turán Type Problem Concerning the Powers of the Degrees of a Graph

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Cycles in a Graph Whose Lengths Differ by One or Two

Mean Ramsey-Turán numbers

The number of generalized balanced lines

A Note on Maximum Independent Sets in Rectangle Intersection Graphs

Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

Single machine parallel batch scheduling with unbounded capacity

The Goldberg Rao Algorithm for the Maximum Flow Problem

3. Linear Programming and Polyhedral Combinatorics

IRREDUCIBLE OPERATOR SEMIGROUPS SUCH THAT AB AND BA ARE PROPORTIONAL. 1. Introduction

Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

INDISTINGUISHABILITY OF ABSOLUTELY CONTINUOUS AND SINGULAR DISTRIBUTIONS

The Ideal Class Group

OPRE 6201 : 2. Simplex Method

Approximating the Minimum Chain Completion problem

24. The Branch and Bound Method

Analysis of Approximation Algorithms for k-set Cover using Factor-Revealing Linear Programs

8.1 Min Degree Spanning Tree

n k=1 k=0 1/k! = e. Example 6.4. The series 1/k 2 converges in R. Indeed, if s n = n then k=1 1/k, then s 2n s n = 1 n

FALSE ALARMS IN FAULT-TOLERANT DOMINATING SETS IN GRAPHS. Mateusz Nikodem

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Secure Network Coding on a Wiretap Network

1 Solving LPs: The Simplex Algorithm of George Dantzig

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Stationary random graphs on Z with prescribed iid degrees and finite mean connections

Mathematical Induction

MATHEMATICAL ENGINEERING TECHNICAL REPORTS. An Improved Approximation Algorithm for the Traveling Tournament Problem

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Triangle deletion. Ernie Croot. February 3, 2010

Collinear Points in Permutations

RN-Codings: New Insights and Some Applications

On Integer Additive Set-Indexers of Graphs

Local periods and binary partial words: An algorithm

Transportation Polytopes: a Twenty year Update

Network (Tree) Topology Inference Based on Prüfer Sequence

SEQUENCES OF MAXIMAL DEGREE VERTICES IN GRAPHS. Nickolay Khadzhiivanov, Nedyalko Nenov

CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010

Ideal Class Group and Units

On the independence number of graphs with maximum degree 3

ERDOS PROBLEMS ON IRREGULARITIES OF LINE SIZES AND POINT DEGREES A. GYARFAS*

The degree, size and chromatic index of a uniform hypergraph

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Lecture 1: Systems of Linear Equations

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

ON DEGREES IN THE HASSE DIAGRAM OF THE STRONG BRUHAT ORDER

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Classification of Cartan matrices

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Max-Min Representation of Piecewise Linear Functions

Lecture 1: Course overview, circuits, and formulas

Labeling outerplanar graphs with maximum degree three

Midterm Practice Problems

Exponential time algorithms for graph coloring

Transcription:

On Data Recovery in Distributed Databases Sergei L. Bezrukov 1,UweLeck 1, and Victor P. Piotrowski 2 1 Dept. of Mathematics and Computer Science, University of Wisconsin-Superior {sbezruko,uleck}@uwsuper.edu 2 National Science Foundation, Arlington, VA, USA vpiotrow@nsf.gov Dedicated to the memory of Rudolf Ahlswede Abstract. We present an approach for data encoding and recovery of lost information in a distributed database system. The dependencies between the informational redundancy of the database and its recovery rate are investigated, and fast recovery algorithms are developed. Keywords: database, iterative code, RAID. 1 Introduction We consider the graph-theoretical model of a distributed database system by which we mean a graph G whose vertices correspond to the nodes of the database where the information is stored (e.g. computer disk drives or computing centers). These nodes are interconnected by a network modeled by the edges of G. Each node of the database can be in one of two states: healthy or faulty. If a node is in the healthy state, one has full access to the data stored in it. Otherwise, no data stored in that node is accessible. We investigate the possibility to recover this data by using the data stored in some other nodes. One of the simplest ways to improve the database reliability is frequently used in practice: duplication of the data stored in each node in other nodes. This provides the fastest recovery rate in terms of the number of other node accesses, as one just needs to read the data from some node mirroring the faulty one. However, this approach noticeably increases the database s informational redundancy, since if s nodes could fail simultaneously, then it is necessary to duplicate s times the data stored in each node of the network. The main goal of our research is to decrease the redundancy of the database system by decreasing the recovery rate while keeping it within acceptable limits. We distinguish two recovery modes: online and offline. The online recovery starts after every data request to a faulty node. The main goal is to complete the request as soon as possible by recovering just the queried node data and not taking care of recovering the other faulty nodes (if any). In contrast to that, the offline maintenance mode is scheduled at regular intervals (e.g., when the database access rate is low), and its goal is the fastest data recovery for all faulty nodes (if any). H. Aydinian, F. Cicalese, and C. Deppe (Eds.): Ahlswede Festschrift, LNCS 7777, pp. 419 431, 2013. c Springer-Verlag Berlin Heidelberg 2013

420 S.L. Bezrukov, U. Leck, and V.P. Piotrowski To be more specific, we assume that the database network is represented by an n-dimensional k k k grid R. A similar architecture is used, for example, in the RAID technology. Our approach is based on a coding theory technique and assigning symbols of some large alphabet to the nodes. Thus, we consider the data stored in the system as a word of length k n over this alphabet. Furthermore, we assume that the information is encoded using n- dimensional iterative codes [2], whose every inner code is capable to recover up to t k erasures. We only deal with combinatorial aspects of the data recovery problem specified below and do not address the encoding/decoding of data and its technical implementation. Without loss of generality, we assume that in the online mode the goal is to recover the node corresponding to the origin of R. Definition 1. AcollectionT of faulty points of R is called a configuration. Each configuration corresponds to the set of erasures in the code word. Definition 2. The process of recovery of the erasures in a code word of any inner code is called a decoding step. After every decoding step the initial configuration T is transformed into a smaller one T T by deleting from T all points belonging to some line l (i.e., the collection of all points of R that agree in n 1 coordinates) provided that l T t. We assume that every decoding step takes the same time. Definition 3. The configuration T is called t-decodable (or simply decodable if it is clear from the context what t is) if for any point f T there exists a sequence of decoding steps s 1,...,s r, (which is called the decoding scheme) resulting in a configuration T with f T. The minimum number r of steps required to remove f from T is called the complexity of T with respect to f. Iff=(0,...,0), then r is simply called the complexity of T and denoted by L(T ). We call a subset D T a deadlock if for any line l of R the condition D l implies D l >t. Clearly, no point of of a deadlock D can be eliminated in a decoding step. Obviously, every non-decodable configuration T contains adeadlock. LetD(T ) denote the (inclusion-)maximal deadlock of T for nondecodable T.NotethatD(T ) unique. Indeed, if there are two maximal deadlocks D 1 and D 2, then the set D = D 1 D 2 is a deadlock, too. This contradicts the maximality of D 1 and D 2 unless D 1 = D 2. For the rest of the paper we assume that n =2. Wewillrefertothehorizontal and vertical lines of R also as rows and columns, respectively. Let F (m, k, t) =max(l(t )), where the maximum is taken over all t-decodable configurations T R of size m. Inotherwords,F equals the minimum number of decoding steps needed in the worst case to recover the origin in a decodable configuration of size m. In practice, this is proportional to the recovery time, provided that the access time is the same for each node of R. It may appear more natural to define F (m, k, t) asthemaximumofl(t ) over all configurations that allow the recovery of the origin (instead of being

On Data Recovery in Distributed Databases 421 completely decodable). Note that this is equivalent to the given definition which follows by the observation that if T is non-decodable but allows the recovery of the origin, then L(T )=L(T \ D(T )). 2 Preliminary Results Theorem 1. Every configuration of size m is decodable if and only if m (t +1) 2 1. Proof. The bound is necessary, since if T is a (t +1) (t + 1) subgrid of R, then no decoding step can be applied. The sufficiency of the condition follows from the fact that for any configuration T of size m<(t +1) 2, there exists a line l such that 0 < l T t. Indeed, by changing the order of rows and columns of T, without loss of generality we can assume that T Q, whereq =[0,a 1 ) [0,a 2 )forsomea 1,a 2 with 0 <a i k for i =1, 2, and every line of Q contains some point of T. If every line in Q contains at least t +1pointsofT then a i t +1fori =1, 2, so T (t +1) 2. Hence, we can perform a decoding step along the line l and get a decodable subconfiguration of T of smaller size. The rest of the proof can done by induction on m. Note that Theorem 1 can easily be extended to n 2, where the inequality becomes m (t +1) n 1. Lemma 1. If T is a t-decodable configuration, then it is possible to remove all points from T in at most 2k t decoding steps. Proof. Let T be t-decodable. Consider in some decoding sequence for T the situation when for the (k t)-th time a row has been chosen. (If that situation never occurs, then we are done because T is completely decoded in less than k t horizontal and at most k vertical steps.) After this, on any column at most t points of T remain which can be decoded by choosing columns only. That is, T can be decoded by choosing k t rows and at most k columns. As an immediate consequence we obtain a sharp upper bound for the size of a t-decodable configuration. Theorem 2. If T is a t-decodable configuration, then T k 2 (k t) 2. Proof. Let T be a t-decodable configuration. As in every decoding step at most t points can be removed from T, Lemma 1 implies T (2k t)t = k 2 (k t) 2. The bound in Theorem 2 is tight, and it is attained for the configuration obtained from R by deleting a (k t) (k t) subgrid. By Theorem 1, every configuration of size m (t +1) 2 1 is decodable. For (t +1) 2 m k 2 (k t) 2 some configurations of that size m are decodable, and some are not. For m exceeding the threshold stated in Theorem 2, no configuration is decodable.

422 S.L. Bezrukov, U. Leck, and V.P. Piotrowski Theorem 3. If 2t m k 2 (k t) 2,then { } m 1 F (m, k, t) min t +2,k t +1. 2 Proof. It is straightforward to verify that for every initial segment of length m k 2 (k t) 2 of the following numbering of points its complexity matches the given lower bound. First we number the points on the axes in alternating order, that is, (0, 0), (0, 1), (1, 0), (0, 2), (2, 0),...,(0,k 1), (k 1, 0). Then we proceed in similar fashion with the remaining points in the first row and in the first column and number them alternating between the row and the column. In general, after numbering all points of the l-th row and l-th column we proceed with numbering the remaining points of the (l + 1)-st row and the (l + 1)-st column in alternating order. Let T be any configuration of m faulty nodes. Denote by L(T,t) the minimum number of decoding steps to delete the origin from T by using the inner codes capable of correcting up to t errors. Let L(m, t) =max T =m L(T,t). In other terms, L(m, t) =F (m,,t). Theorem 4. L(m, 1) = m 1 2 +1. Proof. Let T be a 1-decodable configuration of maximum complexity for its size. We convert T into a configuration of the same size and with no smaller complexity, all whose points are on the axes. Assume that the last step in some optimal decoding scheme for T was applied along the y-axis, and denote A = {(x, 0) T }, B = {(0,y) T }, C = {(x, y) y>0and(x, 0) A}. We first show that C T =. Indeed, assume z C T.Ifz was not deleted from T in our decoding scheme, we can obviously put it on the y-axis without decreasing the complexity. Otherwise, since the column through z contains two points of T, it can only be removed from T by applying a decoding scheme along the row through z. For t = 1 the only reason to apply a row decoding step through z is to be able to apply a column decoding step through z afterwards in order to remove some point of A. But since the last decoding step was applied along the y-axis, one or both decoding steps involving z could be skipped and we would get a decoding scheme for T requiring fewer steps. Therefore, no decoding step was performed along the columns passing through the points of A. In other words, no point from the x-axis is removed. Further note that the decoding steps could be rearranged so that the removal of the

On Data Recovery in Distributed Databases 423 points of B is done during the very last decoding steps. Denote by D the set of points in T which were removed in decoding steps before the first point of B is removed. One has L(T )=L(m, 1) = B + D. Since T could be also decoded by applying the decoding steps along the columns through the points of A, this scheme should not require fewer steps than the optimal one. In other terms, B + D A. Hence, if we place the points of D on the y-axis, the resulting configuration would have complexity B + D and could be decoded by applying the decoding steps along the rows only. If there are some other points of T outside the axes, we put them all on the x-axis. The resulting configuration has all its points on axes and is of complexity L(m, 1). It is easily seen that among such configurations the one that has m 1 m 1 2 points on the x-axis (excluding the origin) and 2 points on the y-axis has maximum complexity. 3 The Absolute Complexity of a Configuration Definition 4. The absolute complexity A(T ) of a configuration T is the minimum number of decoding steps necessary to delete all points of T. Let G(m, k, t) =maxa(t ), where the maximum is taken over all t-decodable configurations T of size m in R. The next statement explores the function G(m, k, t). Lemma 2. If m<k 2 (k t) 2 then G(m, k, t) G(m +1,k,t) G(m, k, t)+1. Proof. To prove the first inequality, consider a configuration T of size m and absolute complexity G(m, k, t), where m<k 2 (k t) 2. If at every decoding step of some decoding scheme exactly t points are removed from T, the inequality is obvious. Assume that at some decoding step less than t points are removed from T and consider a decoding scheme in which such a step occurs as early as possible. Let q be that decoding step number, and assume it is performed along some column C of R. We show that there exists a point x R \ T such that the configuration T = T {x} is decodable. Let B be the set of points removed at step q, and let y C \ B. Note that B <t. If a decoding step along the row through y was not performed before step q, theny T and adding it to T leads to a decodable configuration of the same absolute complexity. Otherwise, k t + 1 decoding steps were performed prior to step q along the rows through the points in C \B. Consider the decoding step number q 1. We can assume that it is performed along a row through some point y C \ B. Then swapping steps q and q 1, we get a decoding

424 S.L. Bezrukov, U. Leck, and V.P. Piotrowski scheme where the first decoding step that removes less than t points from T is performed along the row through y. By a similar argument, among the steps preceding the q-th there must be k t + 1 along columns (including C). In other words, during the first q 2 steps the decoding was performed along some k t rows and some k t columns, and 2t(k t) points are removed from T (so q =2(k t)+2). Hence, after the first q 2 decoding steps the remaining part T of T is a subset of the intersection of some t rows and t columns of R, implying T t 2. None of these rows and columns was used in a previous decoding step. Thus, if T <t 2 we can add a point to T leaving it decodable. Finally, if T = t 2,thenm = T = T +2t(k t) =k 2 (k t) 2, a contradiction. Therefore, the absolute complexity z of T = T {x} satisfies z G(m + 1,k,t). Obviously, deleting a point from T leads to a configuration of no larger absolute complexity. Let us delete x from T and obtain T. Hence, G(m, k, t) z G(m +1,k,t). To show the second inequality from the statement, let T be a decodable configuration of size m + 1 and absolute complexity G(m +1,k,t). After one decoding step one obtains a decodable configuration of size m m. Using the first inequality from the statement, one has G(m +1,k,t) 1+G(m,k,t) 1+G(m, k, t), which completes the proof. Let m(l, k, t) denote the minimum cardinality of a decodable configuration of complexity l in R. Note that m(l, k, t) is well-defined by Lemma 2 for 1 l max A(T ), where the maximum is taken over all t-decodable configurations T in R. For fixed k, t we abbreviate m(l, k, t) by m(l). According to the next lemma, the largest l for which m(l) isdefinedis2k t. Lemma 3. max A(T )=2k t, where the maximum is taken over all t-decodable configurations T in R. Proof. Note that A(T ) 2k t follows immediately from Lemma 1. Finally, T = {(i, j) :0 i, j k 1, min{i, j} t 1} is a decodable configuration of size k 2 (k t) 2 =(2k t)t. As any decoding step removes at most t points, T can not be completely decoded in less than 2k t steps. In what follows, m(l) will be determined completely. Obviously, m(l) =l for l k, and an extremal configuration consists of l points placed on a diagonal of R. The next step is to evaluate m(k +1). Theorem 5 { 2t + k 1, if 1 t k/2, m(k +1)= 2t + k, if k/2 <t<k.

On Data Recovery in Distributed Databases 425 Proof. Let T be a decodable configuration with A(T )= k+1 and T = m(k+1). Then at least one column of R intersects T in at least t+1 points, since otherwise a trivial column-by-column decoding leads to A(T ) k. Similarly, at least one row of R intersects T in at least t + 1 points. Without loss of generality, we can assume that each of the coordinate axes contains at least t +1 points fromt. If there are x + t points from T on the horizontal axis for some x 1, and y + t points from T on the vertical axis for some y 1, then at least x+y+1 decoding steps are needed just to delete these points from T. In each of the remaining k +1 (x + y +1)=k x y steps at least one point is removed from T,so T (x + t)+(y + t) 1+k x y =2t + k 1. This bound it tight for t k/2, since the configuration {(i, 0) i =0, 1,...,2t 1} {(0,j) j =0, 1,...,k 1} is of size 2t + k 1 and has absolute complexity k +1. Assume that t>k/2andthatt is a configuration of size 2t + k 1and absolute complexity k + 1. Without loss of generality, we can again assume that both axes intersect T in at least t + 1 points. There exists an algorithm for decoding T whichremovesthepointsfromeachaxisassoonasonlyt points are left on the axis. Since the number of decoding steps is at least k +1andintwo of those steps t points are removed, exactly one point must be removed in every other step, and the total number of steps must be exactly k + 1. This implies that there is no line L with 2 T L t because otherwise we could remove the points from L T in the very first decoding step. Assume that there is a column V different from the axis and such that T V t +1. Since t > k/2theremustbearowh different from the axis andsuchthat T H 2. Hence, T H t + 1, so for the part T T consisting of the intersections of T with H, V and the coordinate axis, one has 2t + k 1= T T 4t. This contradicts t>k/2. Consequently, every column different from the axis contains at most one point of T. This implies 2k 1 T =2t + k 1, contradicting t>k/2. Finally, m(k +1)= 2t + k for t>k/2 follows by the observation that the configuration {(i, 0) i =0, 1,...,t} {(j, 0) j =0, 1,...,t} {(h, h) h =0, 1,..., k 1} has size 2t + k and absolute complexity k +1. Lemma 4. If l<2k t, thenm(l) <m(l +1). Proof. Assume the contrary, m(l+1) m(l). Let T be a decodable configuration of complexity l + 1suchthat T m(l). Our assumption implies that such configuration exists. Let T be obtained from T by making the first step in a decoding of T that uses A(T ) steps. Then T < T m(l) anda(t )= A(T ) 1=l. This contradicts the definition of m(l).

426 S.L. Bezrukov, U. Leck, and V.P. Piotrowski Corollary 1. If k<l 2k 2t +1 and 2 t k/2, thenm(l) =l +2t 2. Proof. Theorem 5 and Lemma 4 imply that for l = k +1+s one has m(l) m(k +1)+s =2t + k 1+s = l +2t 2. The matching upper bound is attained for the following configuration: {(0, 0), (1, 0),...,(2t + s 1, 0)} {(0, 0), (0, 1),...,(0, 2t + s 1)} {(2t + s, 2t + s), (2t + s +1, 2t + s +1),...,(k 1,k 1)}. This configuration is of cardinality l + 2t 2 and complexity l. The construction worksaslongas2t + s k, which is equivalent to l 2k 2t +1. In the next theorem we establish general lower and upper bounds for the minimum size of a configuration of the maximum absolute complexity 2k t. Theorem 6. 2k + t 1 m(2k t) 2k +(t +1) 2 4 holds for any 1 t<k. Proof. For the upper bound, the following configuration can be used:. k t 2 (t +2) (t +2) kernel k t 2 t 1 Fig. 1. A construction for the upper bound of m(2k t, k, t) The kernel consists of all points of the (t+2) (t+2) corner subgrid excluding the diagonal points {(i, t +1 i) i =0, 1,...,t 1} and the points {(j, 0) j = t, t+1} of the bottom line. Hence, every column of the kernel has t+1 points, the bottom row has t points, the next row has t +2points,andallotherrowshave t+1 points. The size of this configuration is (t+2)(t+1)+(t 1)+2(k t 2) = 2k +(t +1) 2 4.

On Data Recovery in Distributed Databases 427 The only way to decode the kernel is to start with its bottom line, for which k t 2 rightmost points on the horizontal axis must be deleted first. For this, in turn, we have to delete all the points of the last column, for which (k t 2)+ 1 steps are needed. After this the kernel can be decoded in t + 4 steps. This implies that the absolute complexity of the configuration is 2k t. To prove the lower bound, we proceed by induction on k. If k = t +1, then m(2k t) =m(k + 1) which is equal to 2t + k =2k + t 1 by Theorem 5. Assume that k t +2andthatm(2(k 1) t, k 1,t) 2k + t 3. Let T be a configuration of size m(2k t) and absolute complexity 2k t in the k k grid R. If every row of R intersects T in at least t + 1 points, then T = m(2k t) k(t +1) 2k + t 1, and we are done. That is, we can assume that there is a row r that intersects T in at most t points. For symmetry, we can also assume that there is a column c with c T t. Let T be the configuration (in a (k 1) (k 1) grid) obtained from T by removing the points on r and c. As A(T )=2k t and A(T ) 2(k 1) t, it follows that A(T )=2(k 1) t and that there are at least two points of T in r c. Using the induction hypothesis, we obtain m(2k t) = T T +2 m(2(k 1) t, k 1,t)+2 2k t 1. Inthecasewhent = 2 the maximum complexity of a decodable configuration is 2k 2. According to the previous results, we know the function m(l) for l 2k 2t +1 =2k 3. Consequently, the only remaining case for t =2is the value of m(2k 2). By Theorem 6, we know that if t =2,then2k +1 m(2k 2) 2k + 5. The exact values for all k are given in Theorem 7. Theorem 7 7, if k =3 10, if k =4 m(2k 2,k,2) = 14, if k =5 16, if k =6 2k +5, if k 7. Proof. It is an easy exercise to show that the absolute complexities of the configurations shown in Figure 2 are the same as in the statement, thus establishing an upper bound for m(2k 2,k,2) when 3 k 7. Furthermore, the upper bound of 2k +5fork 7 follows from Theorem 6. So, we concentrate on lower bounds. The value for k = 3 follows from Theorem 5 or Theorem 6. To prove the theorem for larger k, we first make a general observation. Let T be a minimum-size configuration of absolute complexity 2k t in a k k grid. The pigeonhole principle, together with the already established upper bound for T, implies that there is a row r that contains at most 2 points from T.Ifthere is an empty column, then making the first decoding step along r results in a decodable configuration in a (k 1) (k 1)-grid. Then the complexity of T does not exceed 2(k 1) t +1 = 2k t 1, contradicting the choice of T. Hence, without loss of generality we can assume that every column of the grid has a non-empty intersection with T.

428 S.L. Bezrukov, U. Leck, and V.P. Piotrowski k =3,m =7 k =4,m =10 k =5,m =14 k =6,m =16 k =7,m =19 Fig. 2. Minimum-size configurations of complexity 2k 2fork =3, 4, 5, 6, 7 Next, we consider the case k = 4. It is sufficient to show that every decodable configuration of size 9 can be decoded in 5 steps. If the first two decoding steps can be applied to some row and some column and result in the removal of at at least 3 points from T, then we end up with a configuration of size at most 6 in a 3 3 grid which can be decoded in 3 steps. Hence, T can be decoded in 5 steps. By this, without loss of generality we can assume that no row or column of the grid contains exactly 2 points of T.Letc i be the size of the intersection of the i-th column of the grid with T. Clearly, c 1 + c 2 + c 3 + c 4 =9,andwithout loss of generality, we can assume c 1 c 2 c 3 c 4. Taking into account that c i {1, 3, 4} for i =1, 2, 3, 4, it turns out that the only choice for (c 1,c 2,c 3,c 4 ) is (4, 3, 1, 1). It follows some row of the grid contains exactly 2 points from T, and we are done. The cases k =5andk = 7 can be handled similarly, although there are more subcases to consider. In the proof of the lower bound in Theorem 6 we presented an argument that shows that m(2k 2,k,2) m(2(k 1) 2,k 1, 2) for k 4. By this, the claim for k = 6 is implied by the result for k = 5, and the claim for k 7 follows by straight forward induction on k, for which k = 7 serves as the base case.

4 Complexity of Data Recovery On Data Recovery in Distributed Databases 429 Here we deal with the complexity aspects of the data recovery problem. The following lemma plays a central role in our analysis. Lemma 5. Let T R be a configuration. Assume there exists a line l of R such that 0 < T l t, andlett = T \ (T l). Then T is decodable if and only if T is decodable. Proof. Indeed, if T is decodable, then so it is T since T T. In fact, the decoding scheme for T can be applied to decode T. On the other hand, if T is decodable, then T can be decoded by decoding along l in the first step and then applying the decoding scheme for T. By Lemma 5, if T is decodable, then we can convert T into the empty set using feasible decoding steps in any order. Recall from introduction that D(T ) denotes the (inclusion-)maximal deadlock of a non-decodable configuration T. Lemma 6. If T, l, andt are as in Lemma 5, then D(T )=D(T ). Proof. If T is decodable, then Lemma 5 implies D(T )=D(T )=. Assume that T is not decodable. Since T T we have D(T ) D(T ). Assume there is some p D(T ) \ D(T ). This means that some line l intersecting D(T )after deleting all points on l intersects D(T ) in less points than before. But this is impossible as no point on l belongs to D(T ). By Lemma 6, the deadlock D(T ) consists precisely of those points that cannot be deleted from T in decoding steps. Thus, we get a polynomial time algorithm for constructing D(T ) by applying decoding steps in any order, and this way shrinking T down to D(T ). As a corollary, we get solutions to the following Problems 1 and 2 in polynomial time. PROBLEM 1. Instance: A list of faulty nodes T R, k, t, andapointp T. Question: Is it possible to recover the contents of the node p? For this, we just need to check whether p D(T ). PROBLEM 2. Instance: AsetT R of faulty nodes, k, andt. Question: Is it possible to recover the data from all faulty nodes? For this, we just need to check whether D =. PROBLEM 3. Instance: A list T R of faulty nodes and an integer s. Question: Is there a decoding scheme of complexity at most s?

430 S.L. Bezrukov, U. Leck, and V.P. Piotrowski Proposition 1. Problem 3 is NP-complete. Proof. The statement follows directly from the NP-completeness of the problem considered in [1]. PROBLEM 4. Instance: A list T R of faulty nodes, a node p T, and integer an s. Question: Is there a decoding scheme of complexity at most s to restore the content of node p? Theorem 8. Problem 4 is NP-complete. Proof. Obviously, the problem is in NP. We reduce the Exact-3-Cover Problem, which is known to be NP-complete [3], to our problem. Given an instance {X 1,...,X r } of 3-subsets of U = {1,...,3m}, fori U denote d i = {j i X j }. We construct an instance of our problem for t =max{max i d i, 3}. Consider the set T of faulty nodes defined as follows where T = A B C D E, A = {(i, 0) i =0,...3m + t 1}, r B = (X i i), C = i=1 3m i=1 {(i, r + j) j =1,...,t di }, D = {(0,r+ j) j =1,...,t+1}, E = {(i, j) 3m +1 i 3m + t +1,r+1 j r + t +1}. Obviously, construction can be accomplished in polynomial time. We show that for the selected t thenode(0, 0) can be restored in 4m + 1 decoding steps iff there exists an exact cover X = {X i1,...,x im } of U. Indeed, assuming the existence of the exact cover, let us apply m decoding steps through the rows y = i j, j =1,...,m. Now every column x = i for i =1,...,3m contains exactly t faulty nodes, and they can be restored in the next 3m steps. After those decoding steps the number of faulty nodes on the x-axis becomes t and the origin can be restored right away. On the other hand, assume the node (0, 0) can be restored in 4m + 1 steps. Note that no decoding step can be applied for a row or column through the set D E, since every such row/column contains at least t + 1 faulty nodes. In particular, we cannot restore the nodes of C by using the row decodings. Therefore, the only way to restore the origin is to apply a decoding step along the x-axis. This can be only done after restoring the nodes (i, 0) for i =1,...,3m by using the decodings via the columns through the set C, which requires 3m

On Data Recovery in Distributed Databases 431 steps. But for this every such column must have at most t faulty nodes, which could be only established in the remaining m steps by applying the decodings via the rows through the set B, namely via the rows corresponding to the exact cover of U. Acknowledgements. We are grateful to the referee for suggesting the reduction from Exact-3-Cover in the proof of Theorem 8. References 1. Fernau, H.: Complexity of a {0, 1}-matrix problem. Austral. J. Combin. 29, 273 310 (2004) 2. MacWilliams, F.J., Sloane, N.J.A.: The Theory of Error-Correcting Codes, Parts I, II (3rd repr.), vol. 16, XX, 762. North-Holland Mathematical Library, Amsterdam etc., North-Holland, Elsevier (1985) 3. Papadimitriou, C.H., Steiglitz, K.: Combinatorial Optimization: Algorithms and Complexity. Dover (1998)