Information Technology Reference
In-Depth Information
Read-one-write-all replication is a special case of a more general quorum
consensus replication , in which a read action on a data item x replicated at n
servers can be satisfied by accessing p replicas, and a write action on x can be
satisfied by accessing and updating q replicas, where p and q are fixed integers
with p C q>nand q>n=2.Hereq can be less than n, implying that mutual
consistency is not maintained. Each replica must carry the commit timestamp of the
updating transaction, so that a read action can select the most recent replica from
the set of p replicas accessed.
In symmetric update propagation ,thesame SQL statement that specifies the
update in the service request coming from the application program is performed
at all the servers that are designated to hold a replica of a data item to be updated.
Example 13.6 Assume that relation r.X;Y;V/ is replicated at all the servers,
s 0 ;s 1 ;:::;s k , and that a transaction is generated by performing the following
program fragment at server s 0 :
exec sql update r set V D f.Y;V/ where Y D z ;
exec sql select sum .V / into :new_sum from r ;
exec sql commit .
Here f is some arithmetic expression over arguments Y and V ,and z is constant in
the domain of attribute Y . We assume that there is no index to r on Y , so that the
entire relation must be scanned so as to find the tuples that must be updated.
With symmetric propagation of updates, for all i D 0;:::;k, the replica of r
at s i is SIX-locked for commit duration for subtransaction T i started at s i ,andthe
update statement is performed at s i , X-locking for commit duration the tuples to be
updated and writing redo-undo log records to the log at s i for the updated tuples. The
select statement is only performed at the coordinator server s 0 . The commit of the
distributed transaction consisting of subtransactions T 0 ;T 1 ;:::;T k is coordinated
by s 0 with the two-phase commit protocol.
t
Symmetric propagation of updates often repeats work unnecessarily, as is demon-
strated in the above example, where the entire relation r is scanned k C 1 times
for the update. In asymmetric update propagation , the original update statement is
performed at one server only, where the update triggers the generation of the exact
set of tuplewise updates to be performed at the other servers.
Example 13.7 With asymmetric update propagation, if the statistics available in the
system catalog suggest that the condition Y D z is expected to select only a few
tuples, a temporary trigger on r is specified that—upon update of tuple .x; y; v / of
r by this server-process thread—sends to servers s 1 ;:::;s k a request to perform the
statement
exec sql update r set V D v 0 where X D x,
where v 0 D f.y; v /. Then the original update statement
exec sql update r set V D f.Y;V/ where Y D z
Search WWH ::




Custom Search