Information Technology Reference
In-Depth Information
is installed in the server buffer, as explained above. If, on the contrary, the page
is cached for reading at one or more clients, the page is called back from all such
clients. Finally the now current server version of p is shipped to c and recorded as
cached there for writing.
We still have to consider the case in which client c already caches page p with
read privilege at the time it performs the call fix-and-write-latch .p/. In this case,
with our caching protocol, c already has the current version of p in its cache. Thus
c needs only to upgrade its read privilege on p to write privilege. To that end, c
sends the request get-write-privilege .p/ to the server. This request is processed at
the server by the call service-get-write-privilege .p/ (Algorithm 14.6 ).
14.6
Log Management
As in a centralized transaction-server system, the permanent log file of a page-server
system resides on the log disk at the server. In a transaction-server system, all the
log records are also created at the server because all database actions are performed
there by some server-process thread upon requests coming from an application
process.
In a page-server system, or, more generally, in a data-server system, the log
records are created by the client-database-process threads that run at the clients and
perform database actions upon requests coming from local application processes.
The clients store their log records temporarily in main-memory log buffers and may
also use local disks for the purpose, but all the log records created by the clients
must be shipped to the server, obeying the client- WA L protocol.
When the server receives log records from a client, it appends them to the log
buffer, to be flushed from there to the log file. To be prepared for server crashes, a
client must keep a log record until the copy of it shipped to server has been flushed
onto the log disk.
Write-ahead logging on the server side requires that all log records for updates
on page p with LSN s up to and including P AGE -LSN .p/ go to the server's log disk
before page p is flushed onto the server's database disk, while client-side write-
ahead logging requires that all log records for updates on page p with LSN supto
and including P AGE -LSN .p/ are appended to the server's log buffer before page p is
installed in the server's database buffer. These requirements must be fulfilled in an
environment in which log records and updated pages arrive to the server from many
clients.
A problem is that the LSN s of the log records created at different clients can no
longer form a single sequence that increases with the time of performing the logged
action. This is because each client must be allowed to generate LSN softhelog
records for updates by its transactions independently of the LSN s generated at the
other clients. It would be highly inefficient to enquire a new LSN from some global
counter maintained at the server every time an update at some client needs to be
logged.
Search WWH ::




Custom Search