Rac 的GES/GCS原理6(图文解释cache fusion机制2)

Example 2: Read-to-Write Transfer
This example shows how GCS satisfies a request by an instance to read a block for update where
that block is already held read-only by another instance.
Instance 1 requests an exclusive read on the block. Initially, Instance 1 is not aware that the
block is currently held by Instance 2.

 Instance 2 identifies the instance that is the resource master
for the block applying a hash function to the database block address (DBA) of the resource. Instance 1
sends amessage to Instance 3 requesting exclusive access to the block (Figure 22-6).

例2: 读-写传输
这个例子解释了GCS机制在下面条件下的工作原理:一个实例准备从某个数据块读数据以便
跟新,而这个数据块已经被另外的实例以只读模式持有了。

 

实例1要求对数据块一个只读访问。最开始,实例1并不知道这个数据块被实例2持有。实例2
通知资源属主这个数据块正被实例2持有。实例2通知实例数据块的资源属主采用hash函数来
找到该资源的数据库的数据块地址。实例1发送一个信息到实例3,希望对数据块进行专有访问。

 

Instance 3 checks in the GRD and discovers that the block is currently held by Instance 2 for
shared (read) access. Instance 3 sends amessage to Instance 2 requesting that it send the block to
Instance 1 (Figure 22-7).

实例3检查GRD,发现这个数据块当前正被实例2持有,以共享读方式访问。
实例3发送消息,要求实例2把数据块发送给实例1。
Instance 2 sends the block, still SCN 1318, to Instance 2 and downgrades the shared lock to
a null lock (Figure 22-8)。


实例2将发送这个数据块,时间点仍然是1318,实例2将降级共享锁(S)到空锁(null).

Instance 1 receives the block and sends a message to Instance 3 to update the resource status
by setting the lock mode on the block to exclusive (X) (Figure 22-9). Instance 3 updates the GRD.
Instance 1 assumes an exclusive lock and updates the block at SCN 1320.
实例1收到这个数据块之后,将数据块的锁模式设置为专有模式(x),并发送消息给实例3,
要求实例3来修改资源状态。实例3修改GRD。实例1申明对此数据块一个专有锁,并修改数据
块到SCN 1320时间点。

Note that RAC is designed to minimize the number of messages that pass across the interconnect
network. Therefore, Instance 3 sends a message to Instance 2 requesting that it pass the block
to Instance 1 and downgrades the shared lock to a null lock. However, Instance 2 does not reply
directly back to Instance 3. Instead, it passes both the block and the resource status to Instance 1,
which forwards the updated resource status back to Instance 3.

注意RAC数据库的目的是减少内联网络中信息的传递。因此,实例三发送信息给实例2,要求实例
2把数据块发送给实例1并降级自己对数据块的锁模式由share 变为null。但是,实例2不会直接
把结果返回给实例三。实例2会首先把数据块和资源状态信息发送给实例1,实例1再把修改后的
资源状态信息发送给实例3。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值