Information Technology Reference
In-Depth Information
Algorithm 14.2 Client procedure fix-and-write-latch .p/
if page p is cached with write privilege at the client then
acquire a write latch on p
else if page p is cached with read privilege at the client then
acquire a write latch on p
send the request get-write-privilege .p/ to the server
wait for a response
record the write privilege on p in the cache control block
else {page p is not cached locally}
reserve-cache-frame .p/
acquire a write latch on p
send the request get-page .p; “write”/ to the server
wait for a response (copy of p)
install page p into the cache frame
mark p as an unmodified page
record the write privilege on p in the cache control block
end if
return the address of the cache frame of p to the caller
With the caching protocol considered, the commit of a transaction at client c does
not cause any change to the set of pages currently cached at c. This is to say that we
apply inter-transaction caching : a page can reside in a client cache unlatched and
unfixed even if there are no transactions currently active at the client.
Inter-transaction caching makes sense because with fine-grained concurrency
control we allow reads and writes by several active transactions on tuples in the
same page and because a new transaction started at a client may often operate on
the same pages as a recently committed transaction. For example, a long computer-
aided design session is occasionally interrupted by a “save document” request,
which commits the ongoing transaction. The session is then continued with a new
transaction that usually operates on tuples that either are the same as or clustered
close to the ones accessed by the previous transaction.
For a transaction-server system, we defined the concepts of a disk version, buffer
version, and current version of a page and, based on these, a disk version and current
version of a database, where the current version of a database is also called the state
of the database. In a page-server system, the caching of pages at the clients implies
an additional, a third, level for these definitions.
The disk version of page p is the version of p on the server's disk. The server
version of p is the version of p in the server buffer, if p is buffered there, and the
disk version of p otherwise. The server version of the physical database is the set
of server versions of the pages of the database, and the server version of the logical
database is the set of tuples in the server versions of the data pages.
The client version or current version of page p is the version of p cached in
some client cache, if the page is cached at some client, and the server version of
p otherwise. This definition makes sense for the caching protocol discussed in this
chapter, because a page can be cached at more than one client at the same time only
if each client caches the page only for reading, implying that all the cached copies
 
Search WWH ::




Custom Search