Definitioncore
One-copy serializability
Also called 1SR.
An execution on replicated data is one-copy serializable when it is equivalent to a serial execution on a single copy of each item.
One-copy serializability (1SR) is the standard correctness criterion for transactions on replicated data. The database keeps several copies of each item, at different sites, and the system turns each read and write of an item into reads and writes of copies. An execution is one-copy serializable if the users cannot tell it apart from a serial execution of the same transactions on a database with one copy of each item: each transaction reads the same values, and the database ends in the same state. Ordinary serializability of the copy-level execution is not enough. An execution can be conflict serializable as a history over copies and still give results that no one-copy execution gives.
Definition
The definition is that of Bernstein, Hadzilacos and Goodman (1987), Section 8.3. Let be transactions over items , where writes the initial value of every copy. Each item has copies at sites .
Replicated data history. A translation maps each read to a read of one copy, and each write to writes of one or more copies. A replicated data (RD) history is a partial order of the translated operations, plus commits and aborts, such that:
- it keeps the order of the operations inside each transaction;
- every copy that is read was written before, at least by ;
- any two operations on the same copy, at least one of them a write, are ordered;
- if writes and then reads , it reads a copy that it wrote.
A one-copy (1C) history is an ordinary history over the items, as if each item had one copy. As in the book, take every history to be the committed projection of itself.
Reads-from on items. reads from in an RD history if, for some copy , and no other write of comes between them. A transaction reads each item at most once and reads one copy, so this relation is a function. In a 1C history, reads-from is the usual relation on items.
Final writes. is a final write for the copy in if every other write of comes before it. In a 1C history, the final write for is the last write of .
Equivalence. An RD history is equivalent to a 1C history over the same transactions if
- reads from in if and only if reads from in , and
- for each final write in , is a final write in for some copy of .
One-copy serializability. is one-copy serializable if it is equivalent to a serial 1C history.
This is view equivalence between a history over copies and a history over items. Conflict equivalence cannot be used, because the two histories have different operations: two writes of conflict in , but their translations may touch different copies. The second condition asks only that the last write of each item reach some copy. It does not ask the copies to be equal at the end.
A sufficient test. Let be the serialization graph of over copies, with an edge for each pair of conflicting operations on one copy with 's operation first. A replicated data serialization graph (RDSG) is with edges added so that (a) any two transactions that write are connected by a path, in one direction or the other, and (b) if reads from , writes , , and there is a path from to , then there is a path from to . Theorem 8.4 of the book states: if has an acyclic RDSG, then is 1SR, and a topological order of the graph is an equivalent serial order. Most correctness proofs of replica control protocols use this theorem or Theorem 8.3, which states that the same reads-from relation as a serial 1C history in an order consistent with is enough.
Examples and non-examples
Each claim below was checked by a brute-force search over all serial orders, with the helper of the read-one write-all page. is implicit.
Read one, write all. . reads from , so the equivalent serial 1C history is . Write-all with strict two-phase locking gives histories of this kind.
A serial history over copies that is not 1SR. This is history of Section 8.1 of the book, in which wrote only one copy of :
reads from , an old copy. In a serial 1C history in the order , would read from . In the order , would read from . Neither holds, so is not 1SR, although it is serial as a history over copies.
A conflict serializable history over copies that is not 1SR. This is history of Section 8.4. and , with copies :
No two operations touch the same copy, so the copy-level serialization graph has no edges between and . But each transaction reads an item that the other one writes, and neither reads the other's value, so no serial 1C history fits. Two-phase locking on copies cannot prevent this, because the logical conflicts never become conflicts on copies. The available copies algorithm adds checks at commit for this reason.
Copies that differ at the end. . At the end holds the value of and holds the value of . The history is 1SR, and in two ways: in the order the final write of is the final write of , and in the order the final write of is the final write of . The criterion speaks about what transactions read, so a stale copy is harmless as long as no one reads it.
A stale read that 1SR allows. , where starts after commits. reads the initial value from . The history is 1SR in the order : the definition has no notion of real time. A client that sees commit and then starts can still see the old value. Strong one-copy serializability, also called strict serializability, adds the rule that the serial order must respect the real-time order of transactions that do not overlap.
One copy per item. If every item has exactly one copy, an RD history is an ordinary history, and the definition becomes view serializability. So deciding whether a history is 1SR is NP-complete in general, by the NP-completeness of view serializability. Protocols therefore aim at sufficient conditions, such as an acyclic RDSG, that they can enforce one step at a time.
Related definitions
- Serializability and view serializability. 1SR is view serializability where the history on the left is over copies and the serial history on the right is over items.
- Multiversion serializability. Multiversion histories use the same idea: a history over versions is correct if it is equivalent to a serial history over items with one version each. Bernstein, Hadzilacos and Goodman point out that the two theories are very similar.
- Strong one-copy serializability. 1SR plus the real-time order of non-overlapping transactions. It is the transactional form of linearizability, which is defined for single operations on single objects.
- Weaker criteria. Many replicated systems give less than 1SR: snapshot isolation on replicas, the consistency models of replicated stores, and the highly available transactions of Bailis et al., which can run without coordination when the network is partitioned. In the asynchronous model with partitions that can last forever, no system can give 1SR and stay available at the same time.
- Protocols. Read-one write-all and its available copies form, primary copy locking and quorum replication with two-phase locking are the classic protocols that give 1SR.
References
- Philip A. Bernstein, Vassos Hadzilacos and Nathan Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, 1987, Chapter 8, Replicated Data: the write-all-available example (Section 8.1), RD histories, 1C histories and the definition of 1SR with Lemma 8.2 and Theorem 8.3 (Section 8.3), and the replicated data serialization graph with Theorem 8.4 (Section 8.4)
- Philip A. Bernstein and Nathan Goodman, An algorithm for concurrency control and recovery in replicated distributed databases, ACM Transactions on Database Systems 9(4), 1984, pages 596 to 615, one-copy serializability as the correctness criterion for replicated data, and its use to prove the available copies algorithm correct
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag CXP807 Edit this page History Report an error Markdown