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

Past Images
Recall that a past image is a copy of the block, including any changes, that is retained by the sending
instance when a block is transferred to another instance.

过去镜像是某块的一个复制,包含所有的改动,当数据块传输到别的实例上的时候,它会被发送实例保存。


Past images are only created for write-write transfers, which occur when a block is modified by one instance and the same block then needs to be changed by another instance.

过去镜像只因为 写-写传输才产生,就是当一个数据块已经被某个实例改动了,又被一个不同的实例
申请访问并修改。

 Past images are retained for performance reasons, because in certain circumstances, they can reduce recovery time following an instance failure.

过去镜像只因为性能的原因而存在,因为在某些环境下,他可以减少实例的恢复时间。


You saw in Example 3 that Instance 1 kept a past image copy of the block at SCN 1320 until the
current version of the block (SCN 1323) was written back to disk by Instance 4. As all changes are
recorded in the redo logs, you may be wondering why it is necessary to retain past images.

在例子3中,实例1保存了某个数据块在scn 1320的过去镜像,直到scn 为1323的数据块的当前
版本被实例4写回到磁盘。要知道所有的改动都会被redo 日志所记载,所以你可能会奇怪为什么
有必要保留过去镜像。

 

Consider the following scenario: Instance A reads a block into cache and then modifies it 1,000
times. Before the block has been written back to disk, Instance B requests the current version of the
block to update it further. Instance A transfers the block and Instance B modifies it once. Instance B
fails before the block is written back to disk.

考虑下面的场景:实例A从cache 读入一个数据块,然后修改它1000次。在这个数据块被写回
磁盘之前,实例B要求这个数据块的当前版本以便跟新。实例A传输了这个当前版本数据块,
而实例B修改了这个数据块1此。实例B在把数据块写回磁盘之前失败了。


If Instance A did not retain a past image copy of the block at the time of transfer to Instance B,
then in order to perform recovery for Instance B, it would be necessary to read the block from disk
and apply all 1,001 changes.

如果在把最新时间点镜像块传输给实例B前,实例A没有保存数据块的过去时间点镜像,
如果发生了上面的情况要恢复数据,那则有必要从磁盘读取这个数据块,并应用redo 日志
1001次。


However, if Instance A retained a past image, Instance A could be signaled to write the past image of the block back to disk, and only the redo for the single change made
by Instance B would need to be applied.
然而,如果实例A保留了过去时间点镜像,实例A将发起一个操作把过去时间点块写入磁盘,
这时,只有实例B修改产生的redo需要被应用到这个时间点块,即可恢复磁盘信息。

 


Disk Writes
Dirty blocks in the buffer cache are written to disk when the instance requires additional buffers to
satisfy free buffer requests or when it performs a checkpoint.


磁盘写
当实例要求额外的buffer 时,当发生checkpoint 事件时,buffer cache中的脏数据需要被写回磁盘。

Write requests can originate from any instance that has a current or past image of a block. The GCS ensures that only the current version of the block is written back to disk.

写要求可以源自任何有数据块的当前镜像或过去镜像的实例。GCS将确保只有数据块的当前版本
被写回到磁盘。

In addition, it checks that any past image versions of the block are purged from the buffer caches of all other instances.


还有,它将检查所有实例,是否有这个数据块的过去镜像。这些数据信息是否已经从buffer cache
中清除。

In the following example, the instance holding a past image buffer in null mode requests that
Oracle write the buffer to disk.

在如下的列子中,持有某个数据块的过去时间点镜像(在null模式)的实例要求oracle把buffer 数据写回磁盘。


In Figure 22-22, Instance 4 has an exclusive lock on the current version of the block at SCN
1323. The block is dirty. Instance 1 has a null lock on a past image of the block at SCN 1320.

在图22-22中,实例4对某个在SCN 1323 当前版本的数据块持有一个专有锁。这个数据块是
脏数据块。而实例1拥有此数据块在SCN 1320的过去镜像。

Instance 1 requires the buffer occupied by the past image of the block at SCN 1320. The shared disk currently contains the block at SCN 1318.
实例1 要求buffer,这个buffer 被 该数据块的 SCN 1320所持有。而共享磁盘中包含了这个数据块在
scn 1318的版本。

Instance 1 sends a message to Instance 3, which is the resource master instance for the block,
requesting permission to flush the past image (Figure 22-23).
实例1发送消息给实例3,实例3是这个数据块的资源属主,并要求把过去镜像写入磁盘。

 

 


Instance 3 sends a message to the Instance 4, which is holding the current version of the block,
requesting that it write the block to disk (Figure 22-24).
Instance 4 writes the block to disk (Figure 22-25).
实例3发送一个消息给实例4,实例4正持有了准备写入磁盘的数据块的当前版本。
实例4把数据块写入磁盘。

 

 

Instance 4 notifies the resource master,which is  Instance 3,that the block has been successfully
written to disk.The resource role can now become local ,as only Instance 1 is holding a copy
of the block.
实例4通知资源属主(实例3),数据块已经成功写入磁盘。这个资源现在可以本地化了,因为
目前只有实例1持有块的拷贝。

Instance 3 sends a message to Instance 1 requesting that it flush the past image for the block
(Figure 22-27). Instance 1 frees the buffer used by the past image and releases the resource.
实例3发送一个消息给实例1,要求它把该数据块的过去镜像删除。实例1清空 被该数据块
占用的过去镜像,并释放资源。

 

 

 

 


At this point, if more than one instance was holding a past image of the block, the resource
master would signal each instance requesting that the block was flushed.

在这个时间点,如果超过1个实例持有了这个数据块的过去时间点镜像,资源属主
将发出信号,通知它把数据块清除。

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值