
The rest of this paper is organized as follows: Section 2
contains a brief overview of the Real Application Cluster
architecture. Section 3 describes Cache Fusion protocols,
highlighting techniques for read-sharing, write-sharing, as
well as efficient inter-node messaging. Section 4 briefly
discusses RAC mechanisms for Decision Support work-
loads. Section 5 describes recovery mechanisms with
Cache Fusion. Finally, Section 6 concludes.
2. Overview of Real Application Clusters
An Oracle Instance is a collection of processes and mem-
ory accessing a shared set of data files (see Figure 1
below). Each Oracle instance inside RAC has its own pri-
vate set of log files referred to as a Redo Thread. Each
instance also has its own buffer cache of disk buffers, and
taken together, these local caches form a global buffer
cache. In order to maintain cache coherency in this global
cache, global resource control is needed. We call this
resource control mechanism the Global Cache Service
(GCS). For additional details on RAC and GCS, see [3].
The GCS tracks and maintains the locations and access
modes of all cache resources (data blocks) in the global
cache. It synchronizes global cache accesses, allowing
only one instance at a time to modify a cache resource.
The GCS adopts a distributed architecture. Each instance
shares the responsibility of managing a subset of the glo-
bal cache. There are several advantages to this approach.
First, the work of handling cache resource requests can be
evenly divided among all existing database instances. Sec-
ond, in case of hardware or software failure in a node, only
the instance running on the failed node is affected. Access
to cache resources managed by this instance may be tem-
porarily unavailable. However, all other resources will
continue to be accessible.
The assignment of global resources to a particular instance
takes into account the access pattern of cache resources.
Resources accessed most frequently by an instance will be
likely to be managed by the same instance.
By knowing the global view of all data blocks, GCS can
direct a read or write request to the instance that can best
serve it. For example, suppose an instance issues an upda-
tee request for a particular block to the GCS. The GCS
will then forward the request to the instance which has the
current cached buffer for that block. This current holder
will transfer the cache buffer to the requester instance
directly, and the GCS will then update the holder informa-
tion to reflect the fact that the requesting instance is now
the holder.
3. Cache Fusion
Cache fusion refers to the protocol for sharing of instance
buffer cache contents through fast inter-node messaging,
resulting in a cluster-wide global buffer cache. There are
two types of sharing involved: Read-Sharing, which refers
to the mechanism used by a query to access the contents of
another instance’s buffer cache, and Write-Sharing which
refers to the mechanism by which an update operation
accesses data in another instance’s cache. In the following
subsections, we describe both kinds of sharing, followed
by a brief description of inter-node messaging.
3.1 Cache Fusion Read-Sharing
The mechanism for read-sharing in Cache Fusion exploits
Oracle’s Consistent Read (CR) mechanism [1]. CR is a
version-based concurrency control protocol which allows
transactions to perform reads without acquiring any locks.
Each transaction in Oracle is associated with a snapshot
time, known as the System Change Number (SCN), and
the CR mechanism guarantees that any data read by a
transaction is transactionally consistent as of that SCN.
When a transaction performs a change to a block, it stores
the information required to undo that change in a rollback
segment. When a transaction reads a block, the CR mecha-
nism uses the stored undo information to create an earlier
version of the block (a clone) which is consistent as of the
reading transaction’s SCN. Clones are created in-memory
and are never written to disk. A read operation therefore
never needs to wait for another transaction to commit or
abort since the CR mechanism automatically reconstructs
the version of the block required by the operation. This
mechanism therefore allows high concurrency for read
operations.
In RAC, when Instance A requires read access to a block
that is present in the buffer cache in Instance B, it requests
a copy of the block from Instance B without requiring any
change of resource ownership. Instance B creates a trans-
server and system
buffer cache
instance 2
instance N
instance 1
shared datafiles
redo
processes
Figure 1: Oracle Instances in RAC
thread
Fast Inter Node Messaging
评论