RAC's GES/GCS principle 6 (graphic explanation of cache Fusion Mechanism 5)

Source: Internet
Author: User

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.

In the past, an image was a copy of a block, including all the changes. When the data block is transferred to another instance, it will be sent to the instance for storage.

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.

In the past, images were generated only through write-write transmission. That is, when a data block has been changed by an instance, it has been changed by a different instance.
Apply for access and modify.

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

In the past, images existed only for performance reasons, because in some environments, they can reduce the instance recovery time.

You saw in Example 3 that instance 1 kept a past image copy of the block at SCN 1320 until
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.

In Example 3, instance 1 saves a data block in the past image of SCN 1320 until the current image of the data block whose SCN is 1323
The version is written back to the disk by instance 4. You need to know that all the changes will be recorded in the redo log, so you may wonder why
It is necessary to retain the past image.

 

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
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.

Consider the following scenario: instance a reads a data block from the cache and modifies it 1000 times. Written back in this data block
Before the disk, instance B requires the current version of the data block to be updated. Instance A has transmitted data blocks of the current version,
Instance B modifies this data block 1. Instance B failed to write data blocks back to the disk.

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 wocould be necessary to read the block from disk
And apply all 1,001 changes.

If instance A does not save the previous time point image of the data block before transferring the image block at the latest time point to instance B,
If the data needs to be restored in the above case, it is necessary to read the data block from the disk and apply the redo log.
1001 times.

However, if instance a retained a past image, instance a cocould 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 woshould need to be applied.
However, if instance A retains the image of the past time point, instance a will initiate an operation to write the previous time point block to the disk,
At this time, the disk information can be restored only when the redo generated by instance B modification needs to be applied to this time block.

 

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

Disk write
When the instance requires an additional buffer, when a checkpoint event occurs, the dirty data in the buffer cache needs to be written back to the disk.

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.

Write requirements can be originated from any current image with data blocks or instances with past images. GCS will ensure that only the current version of the data block is available
Written back to disk.

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

Also, it checks all instances for the past image of the data block. Whether the data information has been cached from the buffer
.

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

In the following columns, instances that hold a data block's past time point image (In null mode) require Oracle to write the buffer data back to the disk.

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.

In Figure 22-22, instance 4 holds a private lock for a data block in the current version of SCN 1323. This data block is
Dirty data blocks. Instance 1 has the data block in the past image of 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.
Instance 1 requires a buffer, which is held by SCN 1320 of the data block. The shared disk contains the data block in
The version of 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 ).
Instance 1 sends a message to instance 3, instance 3 is the resource owner of the data block, and requires that the previous image be written to the disk.

 

 

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 ).
Instance 3 sends a message to instance 4, and instance 4 is holding the current version of the data block to be written to the disk.
Instance 4 writes data blocks to the disk.

 

 

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.
Instance 4 notifies the resource owner (instance 3) that the data block has been successfully written to the disk. This resource can now be localized because
Currently, only instance 1 has a copy of the block.

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.
Instance 3 sends a message to instance 1, asking it to delete the previous image of the data block. Instance 1 is cleared by this data block
And release resources.

 

 

 

 

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

At this time point, if more than one instance holds the image of this data block from the past time point, the resource owner
A signal is sent to notify it to clear the data block.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.