scieee AI-readable full text Open interactive document viewer

Exploring Key-Value Stores in Multi-Writer Byzantine-Resilient Register Emulations

Tiago, Oliveira,Ricardo, Mendes,Alysson, Bessani

Abstract

Resilient register emulation is a fundamental technique to implement dependable storage and distributed systems. In data-centric models, where servers are modeled as fail-prone base objects, classical solutions achieve resilience by using fault-tolerant quorums of read-write registers or read- modify-write objects. Recently, this model has attracted renewed interest due to the popularity of cloud storage providers (e.g., Amazon S3, Google Storage, Microsoft Azure Storage), that can be modeled as key-value stores (KVSs) and combined for providing secure and dependable multi-cloud storage services. In this paper we present three novel wait-free multi-writer multi-reader regular register emulations on top of Byzantine-prone KVSs. We implemented and evaluated these construc- tions using five existing cloud storage services and show that their performance matches or surpasses existing data-centric register emulations.

Full text

Exploring Key-Value Stores in Multi-Writer Byzantine-Resilient Register Emulations Tiago Oliveira, Ricardo Mendes and Alysson Bessani DI–FCUL–TR–2016–02 DOI:10451/25098 (http://hdl.handle.net/10451/25098) November 2016 Publication without review in the repository of the Department of Informatics of the University of Lisbon, Faculty of Sciences (http://repositorio.ul.pt/handle/10451/12254). Exploring Key-Value Stores in Multi-Writer Byzantine-Resilient Register Emulations∗ Tiago Oliveira, Ricardo Mendes, and Alysson Bessani LaSIGE, Faculdade de Ciˆencias, Universidade de Lisboa – Portugal Abstract Resilient register emulation is a fundamental technique to implement dependable storage and distributed systems. In data-centric models, where servers are modeled as fail-prone base objects, classical solutions achieve resilience by using fault-tolerant quorums of read-write registers or readmodify-write objects. Recently, this model has attracted renewed interest due to the popularity of cloud storage providers (e.g., Amazon S3, Google Storage, Microsoft Azure Storage), that can be modeled as key-value stores (KVSs) and combined for providing secure and dependable multi-cloud storage services. In this paper we present three novel wait-free multi-writer multi-reader regular register emulations on top of Byzantine-prone KVSs. We implemented and evaluated these constructions using five existing cloud storage services and show that their performance matches or surpasses existing data-centric register emulations. Keywords: Byzantine fault tolerance, register emulation, multi-writer, key-value store, data-centric algorithms 1 Introduction Resilient register emulations on top of message passing systems are a cornerstone of fault-tolerant storage services. These emulations consider the provision of shared objects supporting read and write operations executed by a set of clients. In the traditional approach, these objects are implemented in a set of fail-prone servers (or replicas) that run some specific code for the emulation [9,14,18,21,22,28–30,34]. A less explored approach, dubbed data-centric, does not rely on servers that can run arbitrary code, but on passive replicas modeled as base objects that provide a constrained interface. These base objects can be as simple as a network-attached disk, a remote addressable memory, or a queue, or as complex as a transactional database, or a full-fledged cloud storage service. By combining these fail-prone base objects, one can build fault-tolerant services for storage, consensus, mutual exclusion, etc, using only client-side code, leading to arguably simpler and more manageable solutions. The data-centric model has been discussed since the 90s [24], but the area gained visibility and practical appeal only with the emergence of network-attached disks technology [20]. In particular, several theoretical papers tried to establish lower bounds and impossibility results for implementing resilient read-write registers and consensus objects considering different types of fail-prone base objects (readwrite registers [8,19] vs. read-modify-write objects [16,17]) under both crash and Byzantine fault models [7]. More recently, there has been a renewed interest in data-centric algorithms for the cloud-of-clouds model [11,33]. In this model, the base objects are cloud services (e.g., Amazon S3, Microsoft Azure Blob Storage) that offer interfaces similar to read-write registers or key-value stores (KVSs). This approach ensures that the stored data is available even if a subset of cloud providers is unavailable or corrupts their copy of the data (events that do occur in practice [27]). To the best of our knowledge, there are only two existing works for register emulation in the cloud-of- clouds model: DepSky [11], which tolerates Byzantine faults (e.g., data corruption or cloud misbehavior) on the providers but supports only a single-writer per data object, and Basescu et al. [10], which genuinely supports multiple writers, but tolerates only crash faults and does not support erasure codes. In this paper we present new register emulations on top of cloud storage services that support multiple concurrent writers (avoiding the need for expensive mutual exclusion algorithms [11]), tolerate Byzantine ∗This is an extended version of a paper with the same title that appeared on Proceedings of the 20th International Conference On Principles Of DIstributed Systems - OPODIS’16, in December 2016. The main difference here are the proofs that appear on the appendix. 1 failures in base objects (minimizing the trust assumptions on cloud providers), and integrate erasure codes (decreasing the storage requirements significantly). In particular, we present three new multiwriter multi-reader (MWMR) regular register constructions: 1. an optimally-resilient register using full replication; 2. a register construction requiring more base objects, but achieving better storage-efficiency through the use of erasure codes; 3. another optimally-resilient register emulation that also supports erasure codes, but requires additional communication steps for writing. These constructions are wait-free (operations terminate independently of other clients), uniform (they work with any number of clients), and can be adapted to provide atomic (instead of regular) semantics. We achieve these results by exploring an often overlooked operation offered by KVSs – list – which returns the set of stored keys. The basic idea is that by embedding data integrity and authenticity proofs in the key associated with a written value, it is possible to use the list operation in multiple KVSs to detect concurrent writers and establish the current value of a register. Although KVSs are equivalent to registers in terms of synchronization power [13], the existence of the list operation in the interface of the former is crucial for our algorithms. Besides the reduction on the storage requirements, an additional benefit of supporting erasure codes when untrusted cloud providers are considered is that they can be substituted by a secret sharing primitive (e.g., [25]) or any privacy-aware encoding (e.g., [14,32]), ensuring confidentiality of the stored data. The three constructions we propose are described, proved correct, implemented and evaluated using real clouds (Amazon S3 [1], Microsoft Azure Storage [15], Rackspace Cloud Files [5], Google Storage [3] and Softlayer Cloud Storage [6]). Our experimental results show that these novel constructions provide advantages both in terms of latency and storage costs. 2 Related Work Existing fault-tolerant register emulations can be divided in two main groups depending on the nature of the fail-prone “storage blocks” that keep the stored data. The first group comprises the works that rely on servers capable of running part of the protocols [9, 18, 22, 28, 34], i.e., constructions that have both a client-side and a server-side of the protocol. Typically, in this kind of environment it is easier to provide robust solutions as servers can execute specific steps of the protocol atomically, independently of the number of clients accessing it. In the second group we have the data-centric protocols [7,8,17,19,24]. This approach considers a set of clients interacting with a set of passive servers with a constrained interface, modeled as shared memory objects (called base objects). The first work in this area was due to Jayanti, Chandra and Toueg [24], where the model was defined in terms of fail-prone shared memory objects. This work presented, among other wait-free emulations [23], a Byzantine fault-tolerant single-writer single-reader (SWSR) safe-register construction using 5f+ 1 base objects to tolerate ffaults. Further works tried to establish lower bounds and impossibility results for emulating registers tolerating different kinds of faults considering different types of base objects. For example, Aguilera and Gafni [8] and Gafni and Lamport [19] used regular and/or atomic registers to implement crash-fault-tolerant MW and SW registers,1respectively, while Chockler and Malkhi [17] used read-modify-write objects to transform the SW register of Gafni and Lamport [19] in a ranked register, a fundamental abstraction for implementing consensus. Abraham et al. [7] provided a Byzantine fault-tolerant SW register, which was latter used as a basis to implement consensus. The main limitation of these algorithms is that, although they are asymptotically efficient [8], the number of communication steps is still very large, and the required base objects are sometimes stronger than KVSs [17] or implement weak termination conditions [7]. More recently, there has been a renewed interest in data-centric algorithms for the cloud-of-clouds model [10, 11]. Here the base objects are cloud services offering interfaces similar to key-value stores. These solutions ensure that the stored data is available even if a subset of cloud providers is unavailable or corrupts their copy of the data. DepSky [11] provided a regular SW register construction that tolerates Byzantine faults by less than a third of the base objects, ensuring also the confidentiality of the stored data by using a secret sharing scheme [25]. However, to support multiple writers an expensive lock 1From now on we avoid characterizing the constructions about the number of readers, as all constructions discussed in the rest of the paper support multiple readers (MR). 2 Table 1: Data-centric resilient register emulations. * Can be extended to achieve atomic semantics. Work Fault model Technique Base Objects Resilience Semantics Jayanti et al. [24] Byzantine replication atomic registers 5f+ 1 SW safe Gafni and Lamport [19] crash replication atomic registers 2f+ 1 SW regular Chockler and Malkhi [17] crash replication rmw registers 2f+ 1 MW ranked Abraham et al. [7] Byzantine replication regular registers 3f+ 1 SW regular Byzantine replication regular registers 3f+ 1 SW safe Aguilera and Gafni [8] crash replication atomic registers 2f+ 1 MW atomic Bessani et al. [11] Byzantine replication regular registers 3f+ 1 SW regular Byzantine erasure code regular registers 3f+ 1 SW regular Basescu et al. [10] crash replication atomic KVSs 2f+ 1 MW regular* This paper Byzantine replication atomic KVSs 3f+ 1 MW regular* Byzantine erasure code atomic KVSs 4f+ 1 MW regular* Byzantine erasure code atomic KVSs 3f+ 1 MW regular* protocol must be executed to coordinate concurrent accesses. Another work in this line [10] provided a regular MW register that replicates the data by a majority of KVSs. Its main purpose was to reduce the necessary storage requirements. To achieve that, writers remove obsolete data synchronously, creating the need to store each version in two keys: a temporary key, that could be removed, and an eternal key, common for all writers and versions, that is never erased. In the best case, the algorithm requires a storage space of 2 ×S×n, where Sis the size of the data and nis the number of KVSs. Using registers or KVSs as base objects in the data-centric model makes it more challenging to implement dependable register emulations, as general replicas have more synchronization power than such objects [13]. The three new register constructions presented in this paper advance the state of the art by supporting multiple writers and erasure-coded data in the data-centric Byzantine model, using a rather weak base object – a KVS. Two of these constructions have optimal resilience, as they require 3f+1 base objects to tolerate fByzantine faults in an asynchronous system (with confirmable writes) [30]. Table 1 summarizes the discussed data-centric constructions. 3 System Model 3.1 Register Emulation We consider an asynchronous system composed of a finite set of clients and ncloud storage providers that provide a KVS interface. We refer to clients as processes and to cloud storage providers as base objects. Each process has a unique identifier from an infinite set named IDs, while the base objects are numbered from 0 to n−1. We aim to provide MW-register abstractions on top of nbase objects. Concretely, a register abstraction offers an interface specification composed of two operations:write(v) and read(). The sequential specification of a register requires that a read operation returns the last value written, or ⊥if no write has ever been executed. Processes interacting with registers can be either writers or readers. A process operation starts by an invoke action on the register, and ends with a response. An operation completes when the process receives the response. An operation o1precedes another operation o2(and o2follows o1) if it completes before the invocation of o2. Operations with no precedence relation, are called concurrent. Unless stated otherwise, the register implementations should be wait-free [23], i.e., the operation invocations should complete in a finite number of internal steps. Moreover, we provide uniform implementations, i.e., implementations that do not rely on the number of processes, allowing processes to not know each other initially. We provide two register abstraction semantics, regular and atomic, which differ mainly in the way they deal with concurrent accesses [26]. A regular register guarantees only that different read operations agree on the order of preceding write operations. Any read operation overlapping a write operation may return the value being written or the preceding value. An atomic register employs a stronger consistency notion than regular semantics. It stipulates that it should be possible to place each operation at a singular point (linearization point) between its invocation and response. This mean that after a read operation completes, a following read must return at least the version returned in the preceding read, even in the presence of concurrent writes. 3 c bo1 bo2 bo3 bo4 list k='id-ts put'(id-ts+1,'val) WRITE (a) WRITE c bo1 bo2 bo3 bo4 list k='id-ts val ='get'(id-ts) READ (b) READ Figure 1: General structure of our MW-regular register emulations. 3.2 Threat Model Up to fout-of nbase objects can be subject to NR-arbitrary failures [24], which are also known as Byzantine failures. The behavior of such objects can be unrestricted: they may not respond to an invocation, and if they do, the content of the response may be arbitrary. Unless stated otherwise, readers may also be subject to Byzantine failures. Writers can only fail by crashing, because even if the protocol tolerates Byzantine writers, they may always store arbitrary values or overwrite data on the register. Processes and base objects are said to be correct if they do not fail. For cryptography, we assume that each writer has a private key Krto sign some of the information stored on the base objects. These signatures can be verified by any process in the system through the corresponding public key Ku. Moreover, we also assume the existence of a collision-resistant cryptographic hash function to ensure integrity. There might be multiple writer keys as long as readers can access their public counterparts. 3.3 Key-Value Store Specification Current cloud storage service providers offer a key-value store (KVS) interface, which act as a passive server where it is impossible to run any code, forcing the implementations to be data-centric. Specifically, KVSs allow customers to interact with associative arrays, i.e, with a collection of hkey,valueipairs, where any key can have only one value associated at a time and there can not be equal keys. Moreover, the size of stored values are expected to be much larger than the size of the associated keys. We assume the presence of four operations: (1) put(k,v), (2) get(k), (3) list(), and (4) remove(k). The first operation associates a key kwith the value v, returning ack if successful and ERROR otherwise; the second retrieves the value associated with a key k, or ERROR if the key does not exist; the third returns an array with all the keys in the collection, or [] if there are no keys in the collection; and the last operation disassociates a key kfrom its value, releasing storage space and the key itself, returning an ack if successful and ERROR otherwise. Finally, we assume that individual KVS’s operations are atomic and wait-free. 4 Multi-Writer Constructions In this section we describe the three MW-regular register implementations. Before discussing the algorithms in detail (§4.3 to §4.6), we present an overview of the general structure of the protocols (§4.1) and describe the main techniques employed in their construction (§4.2). The correctness proofs of the protocols are presented in the appendix. 4.1 Overview Our three MW-regular protocols differ mainly in the storage technique employed (replication or erasure code), the number of base objects required (3f+ 1 or 4f+ 1), and the number of sequential base object accesses (two or three steps). Excluding these differences, the general structure of all protocols is similar to the one illustrated in Figure 1. In the write operation, the client first lists a quorum of base objects (KVSs) in order to find the key encoding the most recent version written in the system, and then puts the value being written associated with a unique key encoding a new (incremented) version in a quorum. The read operation requires finding 4 the most recent version of the object (as in the first phase of the write operation), and then retrieving the value associated with that key. Notice that our approach considers that each written value requires a new key-value pair in the KVSs. However, it is impossible to implement wait-free data-centric MW-regular register emulations without using at least one “data element” per written version if the base objects do not provide conditional update primitives (similar to Compare-and-Swap) [10, 16]. Therefore, any practical implementation of these algorithms must consider some form of garbage collection, as discussed in §5.2. 4.2 Protocols Mechanisms Our algorithms use a set of mechanisms that are crucial for achieving Byzantine fault tolerance, MW semantics and storage efficiency. To simplify the exposition of the algorithms in the following sections (§4.4 to §4.6), we first describe such mechanisms. 4.2.1 Byzantine Quorum Systems Our protocols employ dissemination and masking Byzantine quorum systems to tolerate up to fByzantine faults [28]. Dissemination quorum systems consider quorums of q=dn+f+1 2ebase objects, requiring thus a total of n > 3fbase objects in the system. This ensures each two quorums intersect in at least f+ 1 objects (one correct). Masking quorum systems require quorums of size q=dn+2f+1 2eand a total of n > 4fbase objects, ensuring thus quorum intersections with at least 2f+ 1 base objects (a majority of correct ones). 4.2.2 Multi-Writer Semantics We use the list operation of KVSs to design MW uniform implementations. This operation is very important as it allows us to discover new versions written by unknown clients. With this, the key idea of our protocols is making each writer to write in its own abstract register in a similar way to what is done in traditional transformation of SW to MW registers [26]. We achieve this by putting the client unique id on each key alongside with a timestamp ts, resulting in the pair hts, idi, which represents a version. This approach ensures that clients writing new versions of the data never overwrite versions of each other. 4.2.3 Object integrity and authenticity We call the pair hdata key,data valueian object. In our algorithms, the data key2is represented by a tuple hts,id, his, where hts,idiis the version, his a cryptographic hash of the data value associated with this key, and sis a signature of hts,id, hi(there is a slight difference in the protocol of §4.6, as will be discussed later). Having all this information on the data key allows us to validate the integrity and authenticity of the version (obtained through the list operation) before reading the data associated with it. Furthermore, if some version has a valid signature we call it valid. A data value is said to be valid if its hash matches the hash present in a valid key (this can only be verified after reading the value associated with the key). Consequently, an object is valid if both the version and the value are valid. 4.2.4 Erasure codes Two of our protocols employ erasure codes [32] to decrease the storage overhead associated with full replication. This technique generates ndifferent coded blocks, one for each base object, from which any m<qbase objects blocks can reconstruct the data. Concretely, in our protocols we use m=f+ 1. Notice that this formulation of coded storage can also be used to ensure confidentiality of the stored data, by combining the erasure code with a secret sharing scheme [25], in the same way it was done in DepSky [11]. 4.3 Pseudo Code Notation and Auxiliary Functions We use the ‘+’ operator to represent the concatenation of strings and the ‘.’ operator to access data key fields. We represent the parallelization of base object calls with the tag concurrently. Moreover, we assume the existence of a set of functions: (1) H(v)generates the cryptographic hash of v; (2) encode(v, n, m) encodes vinto nblocks from which any mare sufficient to recover it; (3) decode(bks, n, m, h)recovers 2For the remaining of this paper we may refer to this only as key. 5 Algorithm 1: Auxiliary functions. 1Function listQuorum() begin 2L[0..n −1] ←⊥; 3concurrently for 0≤i≤n−1do 4L[i]←listi; 5wait until |{i:L[i]6=⊥}| ≥ q; 6return L; 7Function writeQuorum(data key,value)begin 8ACK [0..n −1] ←⊥; 9concurrently for 0≤i≤n−1do 10 ACK [i]←put(data key, value[i])i; 11 wait until |{i:ACK [i] = true}| ≥ q; 12 Function maxValidVersion(L)begin 13 return hvr, his∈n−1 ∪ i=0 L[i] : verify(s, Ku)∧ 6 ∃ hvr0, h0is0∈n−1 ∪ i=0 L[i] : vr0>vr ∧verify(s0, Ku)) ; a value vby decoding any subset of mout-of nblocks from the array bks if H(v) = h, returning ⊥ otherwise; (4) sign(info, Kr)signs info with the private key Kr, returning the resulting signature s; (5) verify(s, Ku)verifies the authenticity of signature susing a public key Ku. Besides these cryptographic and coding functions, our algorithms employ three auxiliary functions, described in Algorithm 1. The first function, listQuorum (Lines 1-6), is used to (concurrently) list the keys available in a quorum of KVSs. It returns an array Lwith the result of the list operation in at least qKVSs. The writeQuorum(data key,value) function (Lines 7-11) is used for clients to write data in a quorum of KVSs. The key data key is equal in all base objects, but the value value[i] may be different in each base object, to accommodate erasure-coded storage. When at least qsuccessful put operations are performed, the loop is interrupted. The last function, maxValidVersion(L) finds the maximum version number correctly signed on an array Lcontaining up to nKVS’ list results (possibly returned from listQuorum function), returning 0 (zero) if no valid version is found. 4.4 Two-Step Full Replication Construction Our first Byzantine fault-tolerant MW-regular register construction employs full replication, storing thus the entire value written in each base object. The algorithm is optimally resilient as it employs a dissemination quorum system [28]. Algorithm 2 presents the write and read procedures for the construction. Processes perform write operations using the procedure FR-write (Lines 1–7). The protocol starts by listing a quorum of base objects (Line 2). Then, it finds the maximum version available with a valid signature in the result using the function maxValidVersion(L) (Line 3), and creates the new data key by concatenating a new unique version, and the hash of the value to be written together with the signature of these fields (Lines 4–5). Lastly, it uses the writeQuorum function to write the data to the base objects (Lines 7). The read operation is represented in the FR-read procedure (Lines 8–22). As in the write operation, it starts by listing a quorum of base objects. Then the reader enters in a loop until it reads a valid value (Line 10–21). First, it gets the maximum valid version listed (Line 11), and then it triggers n parallel threads to read that version from different KVSs. Next, it waits either for a valid value, which is immediately returned, or for a quorum of qresponses (Line 19). The only way the loop terminates due to the second condition is if it is trying to read a version being written concurrently with the current operation, i.e., a version that is not yet available in a quorum. This is possible if the first qbase objects to respond do not have the maximum version available yet. When this happens, the version is removed from the result of the list operation (Line 20), and another iteration of the outer loop is executed to fetch a smaller version. Notice that a version that belongs to a complete write can always be retrieved from the inner loop due to the existence of at least one correct base object in the intersection between Byzantine quorums. Without concurrency, the protocol requires one round of list and one of put for writing, and one round of list and one of get for reading. In fact, it is impossible to implement a MW register with fewer object calls since for writing and reading we always need to use at least one round of put and get operations, respectively, and to find the maximum version available we can only use list or get to 6 Algorithm 2: Regular Byzantine Full Replication (FR) MW register (n > 3f) for client c. 1Procedure FR-write(value) begin 2L←listQuorum(); 3max ←maxValidVersion(L); 4new key ← hmax.ts + 1, c, H(value)i; 5data key ←new key +sign(new key, Kr); 6v[0..n −1] ←value; 7writeQuorum(data key, v); 8Procedure FR-read() begin 9L←listQuorum(); 10 repeat 11 data key ←maxValidVersion(L); 12 d[0..n −1] ←⊥; 13 concurrently for 0≤i≤n−1do 14 valuei←get(data key)i; 15 if H(valuei) = data key.hash then 16 d[i]←valuei; 17 else 18 d[i]←ERROR; 19 wait until (∃i:d[i]6=⊥ ∧d[i]6=ERROR)∨(|{i:d[i]6=⊥}| ≥ q); 20 ∀i∈ {0, n −1}:L[i]←L[i]\ {data key}; 21 until ∃i:d[i]6=⊥ ∧d[i]6=ERROR; 22 return d[i]; retrieve that information from the base objects. 4.5 Two-Step Erasure Code Construction Differently from the protocol described in the previous section, which employs full replication with a storage requirement of q×Swherein Sis the size of the object, in our second Byzantine fault-tolerant MW-regular register emulation we use storage-optimal erasure codes. Since the erasure code we use [32] generates ncoded blocks, each with 1 f+1 of the size of the data, the storage requirement is reduced to q×S f+1 . The main consequence of storing different blocks in different base objects for the same version, is that the number of base objects accessed in dissemination quorum systems is not enough to construct a wait-free Byzantine fault-tolerant MW-regular register. This happens because the intersection between dissemination quorums contains only f+1 base objects, meaning that when reading the version associated with the last complete write operation, the quorum accessed may contain only 1 valid response (fcan be faulty). This is fine for full replication as a single updated and correct value is enough to complete a read operation. However, it may lead to a violation of the regular semantics when erasure codes are employed since we now need at least f+ 1 encoded blocks to reconstruct the last written value. To overcome this issue, we use Byzantine masking quorum systems [28], where the quorums intersect in at least 2f+ 1 base objects. Despite the increase in the number of base objects (n > 4f), the storage requirement is still significantly reduced when compared with the previous protocol. As an example, for f= 1, this protocol has a storage overhead of 100% (a quorum of four objects with coded blocks of half of the original data size) while in the previous protocol the overhead is 200% (a quorum of three objects with a full copy of the data on each of them). Algorithm 3 presents this protocol. The EC-write procedure is similar to the write procedure of Algorithm 2. The only difference is the use of erasure codes to store the data. Instead of full replicating the data, it uses the writeQuorum function to spread the generated erasure-coded blocks through the base objects in such a way that each one of them will store a different block (Lines 6–7). Notice that the hash on the data key is generated over the full copy of data and not over each of the coded blocks. The read procedure EC-read is also similar to the read protocol described in §4.4, but with two important differences. First, we remove from Lthe versions we consider impossible to read (Lines 10– 11), i.e., versions that appear in less than f+1 responses. Second, instead of waiting for one valid response in the inner loop, we wait until we can reconstruct the data or for a quorum of responses. Again, the only way the loop terminates through the second condition is if we are trying to read a concurrent version. For reconstructing the original data, every time a new response arrives we try to decode the blocks and verify the integrity of the obtained data (Line 18). Notice that the integrity is verified inside the decode function. A version associated with a complete write can always be successfully decoded because any 7 [28] D. Malkhi and M. Reiter. Byzantine quorum systems. Distributed Computing, 11(4), 1998. [29] D. Malkhi and M.K. Reiter. Secure and scalable replication in Phalanx. In Proc. of the SRDS, 1998. [30] J.P. Martin, L. Alvisi, and M. Dahlin. Minimal Byzantine storage. In Proc. of the DISC, 2002. [31] T. Oliveira, R. Mendes, and A. Bessani. Exploring key-value stores in multi-writer Byzantine-resilient register emulations. Technical Report DI-FCUL-2016-02, ULisboa, 2016. [32] M. Rabin. Efficient dispersal of information for security, load balancing, and fault tolerance. Journal of the ACM, 36(2), 1989. [33] P. Verissimo, A. Bessani, and M. Pasin. The TClouds architecture: Open and resilient cloud-of- clouds computing. In Proc. of the DCDV, 2012. [34] Y. Ye, L. Xiao, I-L. Yen, and F. Bastani. Secure, dependable, and high performance cloud storage. In Proc. of the SRDS, 2010. 14 A Appendix: Correctness This section presents the correctness proofs of the protocols of Algorithms 2, 3 and 4. We start by proving that the auxiliary functions used by the protocols (presented in Algorithm 1) are wait-free. Lemma 1. Every correct process completes the execution of listQuorum and writeQuorum in finite time. Proof. Both algorithms are used by all protocols. This means that they use both dissemination and masking quorums. Since they send nrequests, one for each base object, and at most fbase objects are allowed to be faulty, a quorum of responses will always be received as q≤n−f. Consequently, both algorithms return in finite time. A.1 Two-Step Algorithms Proof In the following we prove the correctness of Algorithms 2 and 3, as they follow the same rationale, although employing different Byzantine quorum systems. For these proofs, we denote by Lthe output of the listQuorum executed in the beginning of FR-read and EC-read procedures. Moreover we define m as the number of required responses to obtain the requested value. Notice that m= 1 for full replication and m=f+ 1 for erasure-coded data. The next lemmas state that Lcontains a version that respects MW-regular semantics. Lemma 2. A value associated with a complete write operation is always found in L, and can be retrieved from the base objects. Proof. Since we do not consider malicious writers, we know that clients only write valid objects. Furthermore, we know that when listing or reading a dissemination (resp. masking) Byzantine quorum of base objects we will also access f+ 1 (resp. 2f+ 1) objects where the last complete write was executed, as by definition quorums intersect by this amount of objects. Using this fact, the lemma can then be reduced to prove that such intersection will contain mcorrect base objects, which will provide the last version written. This is indeed the case as m= 1 in full replication (intersection of f+ 1 – at least one correct) and m=f+ 1 with erasure coded data (intersection of 2f+ 1 – at least f+ 1 correct). Lemma 3. The maximum version found on Lcorresponds to the last complete write operation, or to a concurrent one. Proof. Lonly contains valid versions that were already stored by a writer, otherwise it would be impossible to find them. Since we do not consider malicious writers, we know they will follow the protocol, for example, by incrementing the maximum ts found and has not lied about his id when creating the pair hts + 1, ci. Therefore, each writer always writes a version larger than the maximum version found, respecting thus partial order. According to Lemma 2, a version whose write is complete is always found in L. Consequently, we can claim that, without concurrency, the maximum version in Lbelongs to the last complete write operation. Furthermore, if there are any concurrent write operation being executed, it may appear as the maximum version found in L, as its version is surely greater then the version of the last complete write. These lemmas allow us to prove that both protocols (Algorithms 2 and 3) respect the specification of a multi-writer multi-reader regular register and are wait-free. Theorem 1. A FR-read (resp. EC-read) operation running concurrently with zero or more FR-write (resp. EC-write) operations will return the value associated with the last complete write or one of the values being written. Proof. Both read procedures start by calling listQuorum. By Lemma 3 we know that the maximum version found in Lbelongs to the last complete write operation or to a concurrent one. Independently of the case, the procedures try to read it. If the version belongs to a concurrent write it may not be retrieved. In this case the algorithms exclude it and fetch the new maximum valid version listed (see loop in Lines 10–21 and 12–21, in Algorithms 2 and 3, respectively). However, according to Lemma 2, if no concurrent version can be read, we know that the value associated with the last complete version is always retrieved. This proves that both protocols respect regular semantics. Theorem 2. The FR-write, EC-write, FR-read and EC-read procedures satisfy wait-freedom. 15 Proof. The FR-write and EC-write procedures, besides executing local computation steps, call the functions of Algorithm 1. Since these functions are wait-free (Lemma 1), the write protocols are also wait-free. Both read operations start by calling the listQuorum, which is wait-free (Lemma 1). After that, the algorithms enter in a loop that only terminates after finding a valid value to return. By Lemma 2 we know that a value associated with a complete version is always found in L, and that this version can be retrieved. Then the number of iterations of this loop is bounded by the number of writes being executed concurrently that can be seen in L, but whose the value cannot be retrieved. Since after failing a read we try a smaller version, the algorithms will eventually try to fetch the value written in the last complete write. Consequently, the read procedures terminate in finite time. A.2 Three-Step Algorithm Proof We now sketch the correctness proof of Algorithm 4. The complete proofs are very similar to the ones presented before for the Algorithms 2 and 3. The main difference here is the existence of the proof object used to prove that the data object associated with it is already stored in a dissemination quorum. The following lemmas state the properties of this object. Lemma 4. The value associated with every valid proof object in Lcan be retrieved from at least f+ 1 base objects. Proof. Each valid proof object found in Lwas previously written by a correct writer. In turn, since we do not consider malicious writers, each writer only replicates the proof object after storing its associated data object in at least q=dn+f+1 2ebase objects. Therefore, we know that the data object associated with a valid proof object in Lis available in at least q−f≥f+ 1 base objects. This means that there will be enough data objects to reconstruct the original value. Lemma 5. The maximum valid version found among the proof objects observed in Lcorresponds to the last complete write, or to a concurrent one. Proof. This can be proved following the same rationale of Lemma 3. Writers are considered correct and therefore they calculate new versions correctly, i.e., they find the maximum valid version on a quorum of proof objects and increment it ensuring that each new version has a greater version number. Furthermore, an 3S-write operation is considered complete only after it writes the proof object to a dissemination quorum. Since we know that the intersection of any two dissemination quorums contains at least f+ 1 base objects, the proof object associated with the last complete write can always be found. This proves that, without concurrency, the maximum version found corresponds to the last complete write operation. If some concurrent writes are being executed, they may be seen as the maximum version because they surely have a greater version than the last complete write. Using these lemmas we are now able to prove that Algorithm 4 respects multi-writer multi-reader regular register semantics and wait-freedom. Theorem 3. A 3S-read operation running concurrently with zero or more 3S-write operations will return the value associated with the last complete write or one of the values being written. Proof. According to Lemma 4, the value associated with each valid proof object in Lcan always be read from the base objects. The protocol reads the value associated with the maximum valid version found in L, and we know by Lemma 5 that this version is associated either with the last complete write or to one of the values being written. Therefore, the value returned by 3S-read belongs to the last complete write or to a concurrent one. Theorem 4. The 3S-read and 3S-write procedures satisfy wait freedom. Proof. The write procedure invokes listQuorum once, to obtain L, and writeQuorum twice, one to write the data blocks and another to write the proof objects. According to Lemma 1, these two operations terminate in finite time, and thus 3S-write always terminates as well. The read procedure also satisfies wait freedom due to Lemma 4: a value associated with a valid proof object is always available for read. 16