Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

A Formal Model for the Deferred Update Replication Technique

  • Conference paper
  • First Online:
Trustworthy Global Computing (TGC 2013)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8358))

Included in the following conference series:

  • 521 Accesses

Abstract

Database replication is a technique employed to enhance both performance and availability of database systems. The Deferred Update Replication (DUR) technique offers strong consistency (i.e. serializability) and uses an optimistic concurrency control with a lazy replication strategy relying on atomic broadcast communication. Due to its good performance, DUR has been used in the construction of several database replication protocols and is often chosen as a basic technique for several extensions considering modern environments. The correctness of the DUR technique, i.e. if histories accepted by DUR are serializable, has been discussed by different authors in the literature. However, a more comprehensive discussion involving the completeness of DUR w.r.t. serializability was lacking. As a first contribution, this paper provides an operational semantics of the DUR technique which serves as foundation to reason about DUR and its derivatives. Second, using this model the correctness of DUR w.r.t. serializability is shown. Finally, we discuss the completeness of DUR w.r.t. serializability and show that for any serializable history there is an equivalent history accepted by DUR. Moreover, we show that transactions aborted by DUR could not be accepted without changing the order of already committed transactions.

Partially supported by FAPERGS and CNPq.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Armendáriz-Iñigo, J.E., de Mendívil, J.R.G., Garitagoitia, J.R., Muñoz-Escoí, F.D.: Correctness proof of a database replication protocol under the perspective of the I/O automaton model. Acta Inf. 46(4), 297–330 (2009)

    Article  MATH  Google Scholar 

  2. Baldan, P., Corradini, A., Montanari, U.: Contextual Petri Nets, asymmetric event structures and processes. Inf. Comput. 171(1), 1–49 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  3. Bernstein, P.A., Hadzilacos, V., Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison-Wesley, San Diego (1987)

    Google Scholar 

  4. Bhargava, B.K.: Concurrency control in database systems. IEEE Trans. Knowl. Data Eng. 11(1), 3–16 (1999)

    Article  Google Scholar 

  5. Budhiraja, N., Marzullo, K., Schneider, F.B., Toueg, S.: The primary-backup approach. Distrib. Syst. 2, 199–216 (1993)

    Google Scholar 

  6. Garcia, R., Rodrigues, R., Preguiça, N.M.: Efficient middleware for byzantine fault tolerant database replication. In: Kirsch, C.M., Heiser, G. (eds.) EuroSys, pp. 107–122. ACM (2011)

    Google Scholar 

  7. Gray, J., Helland, P., O’Neil, P.E., Shasha, D.: The dangers of replication and a solution. In: Jagadish, H.V., Mumick, I.S. (eds.) SIGMOD Conference. pp. 173–182, ACM Press (1996)

    Google Scholar 

  8. Kemme, B., Alonso, G.: A new approach to developing and implementing eager database replication protocols. ACM Trans. Datab. Syst. 25(3), 333–379 (2000)

    Article  Google Scholar 

  9. Kung, H.T., Robinson, J.T.: On optimistic methods for concurrency control. ACM Trans. Datab. Syst. (TODS) 6(2), 213–226 (1981)

    Article  Google Scholar 

  10. Nielsen, M., Plotkin, G., Winskel, G.: Petri nets, event structures and domains, part I. Theor. Comput. Sci. 13(1), 85–108 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  11. Papadimitriou, C.H.: The serializability of concurrent database updates. J. ACM 26(4), 631–653 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  12. Pedone, F., Guerraoui, R., Schiper, A.: Transaction reordering in replicated databases. In: 16th IEEE Symposium on Reliable Distributed Systems (SRDS), pp. 175–182. IEEE (1997)

    Google Scholar 

  13. Pedone, F., Schiper, N.: Byzantine fault-tolerant deferred update replication. J. Brazil. Comput. Soc. 18, 3–18 (2012)

    Article  MathSciNet  Google Scholar 

  14. Schmidt, R., Pedone, F.: A Formal Analysis of the Deferred Update Technique. In: Tovar, E., Tsigas, P., Fouchal, H. (eds.) OPODIS. LNCS, vol. 4878, pp. 16–30. Springer, Heidelberg (2007)

    Google Scholar 

  15. Schneider, F.B.: Implementing fault-tolerant services using the state machine approach: A tutorial. ACM Comput. Surv. (CSUR) 22(4), 299–319 (1990)

    Article  Google Scholar 

  16. Sciascia, D., Pedone, F.: RAM-DUR: In-memory deferred update replication. In: 31st IEEE Symposium on Reliable Distributed Systems (SRDS), pp. 81–90. IEEE (2012)

    Google Scholar 

  17. Sciascia, D., Pedone, F., Junqueira, F.: Scalable deferred update replication. In: 42nd Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN), pp. 1–12. IEEE (2012)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Andrea Corradini .

Editor information

Editors and Affiliations

Appendix

Appendix

We present here the proof of Theorem 2.

Theorem 5

(Well-formed server states are reachable). A server state over a set of transactions \({\mathcal {T}}\) is reachable if and only if it is well-formed.

Proof

Only if part   We must show that the initial state \(D_0\) of Definition 8 is well-formed, and that if \(D\) is well-formed and there is a transition \(D \Rightarrow D'\), then \(D'\) is well-formed as well. Let us consider the six conditions for well-formedness of Definition 7.

  1. 1.

    By definition \({\textit{WS}}_0(0) = X\) holds in \(D_0\), and the only rule that modifies vector \({\textit{WS}}\), that is [commit], changes it at index \({\textit{CI}}+ 1 > 0\); therefore the first condition is satisfied by each reachable state.

  2. 2.

    \(D_0\) satisfies the second condition because \({\textit{CI}}_0 = \bot \). The only rule that modifies \({\textit{WS}}\) is [commit], which also changes \({\textit{SC}}\) and \({\textit{CI}}\) in a way that maintains the invariant described by the second condition.

  3. 3.

    The only rule that modifies the snapshot identifier \({\textit{ST}}(T)\) of a transaction is [read \(-\bot \!\!\) ]: its second premise guarantees the third condition.

  4. 4.

    Finally, conditions 4, 5 and 6 are clearly satisfied by \(D_0\) because \({\textit{CI}}_0 = \bot \), and they express invariants that are easily checked to be maintained by rules [abort], [commit] and [commit-RO], respectively.

If part   Let \(D = {\langle {\textit{SC}}_D, {\textit{WS}}_D, {\textit{ST}}_D, {\textit{CI}}_D \rangle }\) be a well-formed server state over \({\mathcal {T}}\). We proceed by induction on the cardinality of \({\textit{Comm}}(D)\).

If \(|{\textit{Comm}}(D)| = 0\), no transaction of \({\mathcal {T}}\) committed, and therefore we must have \({\textit{SC}}_D = 0, {\textit{WS}}_D = [0 \mapsto X]\), and \({\textit{CI}}_D = \bot \), as no transaction could have aborted either, by condition 4 of Definition 7. Furthermore, \({\textit{ST}}_D(T) \in \{\bot , 0\}\) for all \(T \in {\mathcal {T}}\), i.e. some transactions may already have 0 as snapshot identifier. Let us show that \(D\) is reachable, i.e. \(D_0 {\Rightarrow }^{*} D\) where \(D_0\) is as in Definition 8. In fact, if \(\{T_i\}_{1\le i\le k} = \{T \mid {\textit{ST}}_D(T) = 0\}\), by condition 3 of Definition 7 we know that \(\mathbf{rs }(T_i)\) is not empty for \({1\le i\le k}\), and thus there exists a sequence of transitions \({D_0 \xrightarrow [\textit{[read} -\bot \textit{]}]{{\textit{rec}}(T_1)} D_0^1 \cdots D_0^{k-1} \xrightarrow [\textit{[read} -\bot \textit{]}]{{\textit{rec}}(T_k)} D_0^k = D}\), where for all \(i \in [1,k]\) it holds \({\textit{ST}}_{D_0^i}(T)= 0 \iff T \in \{T_1, \ldots , T_i\}\).

Suppose now that \(|{\textit{Comm}}(D)| = n+1\). We first show that, without loss of generality, we may assume that no transaction aborted yet in \(D\). In fact, if \(\{T_i\}_{1\le i\le k} = \{ T \mid {\textit{CI}}_D(T) = \textit{aborted}\}\), then \(D\) is reachable from a state \(D'\) where those transactions are still active (i.e. \({\textit{CI}}_{D'}(T_i) = \bot \)), with a sequence of \(k\) [abort] transitions, one for each element of \(\{T_i\}_{1\le i\le k}\). The preconditions of such [abort] transitions are satisfied by condition 4 of 7.

Now, assuming that \(D\) has no aborted transactions, let \(T\) be one of the transactions in \({\textit{Comm}}(D)\) with maximal commit index. We have two cases: either \(T\) is read-only or not.

If \(T\) is read-only, by conditions 6 and 2 of Definition 7 we have \({\textit{CI}}_D(T) = {\textit{ST}}_D(T) + 0.5 = {\textit{SC}}+ 0.5\). Consider the server state \(D' = {\langle {\textit{SC}},{\textit{WS}}, {\textit{ST}}', {\textit{CI}}' \rangle }\) where

$$\begin{aligned} {\textit{ST}}'(x) =\left\{ \begin{array}{ll} {\textit{ST}}(x) &{} \text{ if }\; x \not = T\\ \bot &{} \text{ if }\; x = T \end{array}\right.&\qquad \qquad {\textit{CI}}'(x) =\left\{ \begin{array}{ll} {\textit{CI}}(x) &{} \text{ if }\; x \not = T\\ \bot &{} \text{ if }\; x = T \end{array}\right. \end{aligned}$$

State \(D'\) represents a snapshot of the system where all transactions but \(T\) are as in state \(D\), while \(T\) did not start yet (its snapshot identifier is \(\bot \)). It is easily shown that \(D'\) is well-formed, therefore by inductive hypothesis \(D'\) is reachable from \(D_0\).

It remains to show that \(D\) is reachable from \(D'\) by accepting all the requests generated by the execution of \(T\), i.e. \({D'\!\xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T)} D''\!\xrightarrow [{\textit{[read]}}]{{\textit{rec}}(T)} D'' \cdots D''\!\xrightarrow [{\textit{[commit-RO]}}]{{\textit{adel}}(T)} D}\); in fact the first transition sets \({\textit{ST}}(T)\) to \({\textit{SC}}\), and the last one sets \({\textit{CI}}(T)\) to \({\textit{SC}}+0.5\).

If \(T\) is not read-only, by condition 2 of Definition 7 we have that \({\textit{CI}}_D(T) = {\textit{SC}}_D\). Let us additionally assume that \({\textit{ST}}_D(T) = {\textit{CI}}_D(T) -1\). The idea, as in the case just seen, is to remove \(T\) from \(D\) obtaining a state \(D'\) with less committed transactions. But if there are transactions with \({\textit{ST}}_D(T') = {\textit{SC}}_D = {\textit{CI}}_D(T)\), the resulting state would not be well-formed because \({\textit{ST}}_D(T') > {\textit{SC}}_{D'} = {\textit{SC}}_D - 1\).

Therefore let us consider state \(D'\) obtained from \(D\) by setting \({\textit{ST}}_{D'}(T) = \bot \) for all transactions in \(\{T\}_{1\le i \le k} = \{ T \mid {\textit{ST}}_D(T) = {\textit{CI}}_D\}\). We clearly have \(D' {\Rightarrow }^{*} D\) with a sequence of transitions \({D' \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T_1)} D'_1 \cdots D'_{k-1} \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T_k)} D'_k = D}\), which are possible by condition 3 of Definition 7.

Consider now the server state \(D'' = {\langle {\textit{SC}}'',{\textit{WS}}'', {\textit{ST}}'', {\textit{CI}}'' \rangle }\) where

$${{\textit{SC}}''={\textit{SC}}'-1, \qquad \qquad {\textit{WS}}''(x) =\left\{ \begin{array}{ll} {\textit{WS}}'(x) &{} \text{ if }\; x \not = {\textit{SC}}'\\ \bot &{} \text{ if }\; x = {\textit{SC}}' \end{array}\right. }$$
$${{\textit{ST}}''(x) =\left\{ \begin{array}{ll} {\textit{ST}}'(x) &{} \text{ if }\; x \not = T\\ \bot &{} \text{ if }\; x = T \end{array}\right. \qquad \qquad {\textit{CI}}''(x) =\left\{ \begin{array}{ll} {\textit{CI}}'(x) &{} \text{ if }\; x \not = T\\ \bot &{} \text{ if }\; x = T \end{array}\right. }$$

State \(D''\) is the server state before transaction \(T\) has started, and it is easily shown to be well-formed. Therefore by induction hypothesis \(D''\) is reachable from \(D_0\). To show that \(D'' {\Rightarrow }^{*} D'\), we consider two cases, depending on the readset of \(T\).

  1. 1.

    \(\mathbf{rs }(T)=\emptyset \): In this case, the premise of [commit] is satisfied because \(T\) is not read-only, thus \(D'' \xrightarrow [{\textit{[commit]}}]{{\textit{adel}}(T)} \hat{D}\). The resulting state is

    $$\hat{D}= {\langle {\textit{SC}}''+1, {\textit{WS}}''[{\textit{SC}}''+1\mapsto \mathbf{ws }(T)],{\textit{ST}}'',{\textit{CI}}''[T\mapsto {\textit{SC}}''+1] \rangle }$$

    and using \({\textit{SC}}''={\textit{SC}}'-1\), \({\textit{CI}}'(T)={\textit{SC}}'\), \(\mathbf{rs }(T)=\emptyset \) we conclude that

    $$\hat{D}= {\langle {\textit{SC}}', {\textit{WS}}''[{\textit{CI}}'(T)\mapsto \mathbf{ws }(T)],{\textit{ST}}',{\textit{CI}}''[T\mapsto {\textit{SC}}'] \rangle }$$

    and thus \(D'=\hat{D}\) is reachable.

  2. 2.

    \(\mathbf{rs }(T)\ne \emptyset \): Here, analogously to the case of read-only transactions, we may start by an application of rule [read] \(-\bot \) followed by some applications of rule [read] until all variables in \(\mathbf{rs }(T)\) are read, leading to state \(\hat{D}\). Since state \(D\) was well-formed, it is easy to check that rule [commit] is enabled for \(T\) in \(\hat{D}\), and that its application yields state \(D'\).

It remains to consider the last case, where the transaction with highest commit index in \(D\), say \(T\), is not read-only and where \({\textit{ST}}_D(T) < {\textit{CI}}_D(T) -1\). We argue as follows. Let \(D'\) be exactly like \(D\), but with \({\textit{ST}}_{D'}(T) = {\textit{CI}}_D(T) -1\). By the argument just presented we know that \(D'\) is reachable from \(D_0\), i.e. there is a sequence of transitions \(D_0 {\Rightarrow }D_1 \cdots D_{n-1} {\Rightarrow }D_n = D'\). In this sequence, the transition \({\cdot \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T)}\cdot }\), that sets the value of \({\textit{ST}}(T)\), must occur after transition \(\cdot \xrightarrow [{\textit{[commit]}}]{{\textit{adel}}(T')}\cdot \), which sets \({\textit{CI}}(T') = {\textit{CI}}(T) -1\). Between the two transitions, there could be other [read], [read] \(-\bot \) and [commit-RO] transitions only. Now, it is easy to show that \({\cdot \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T)}\cdot }\) can be anticipated by switching it with all these transitions, without affecting the well-formedness of the states and without changing the final state. Finally, when we have the consecutive transitions \({\cdot \xrightarrow [{\textit{[commit]}}]{{\textit{adel}}(T')}\cdot \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T)}\cdot }\), we can switch them by obtaining \({\cdot \xrightarrow [\textit{read}-\bot ]{{\textit{rec}}(T)}\cdot \xrightarrow [{\textit{[commit]}}]{{\textit{adel}}(T')}\cdot }\). This is possible, again, because the well-formedness of state \(D\) ensures that \(\mathbf{ws }(T') \cap \mathbf{rs }(T) = \emptyset \). In the resulting final state only the value of \({\textit{ST}}(T)\) is changed, and it is \({\textit{CI}}(T') = {\textit{CI}}(T) -2\). By iterating this transformation of the sequence of transitions we can show that the original state \(D\) is reachable. \(\square \)

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Corradini, A., Ribeiro, L., Dotti, F., Mendizabal, O. (2014). A Formal Model for the Deferred Update Replication Technique. In: Abadi, M., Lluch Lafuente, A. (eds) Trustworthy Global Computing. TGC 2013. Lecture Notes in Computer Science(), vol 8358. Springer, Cham. https://doi.org/10.1007/978-3-319-05119-2_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-05119-2_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-05118-5

  • Online ISBN: 978-3-319-05119-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics