RAC's GES/GCS principle 6 (graphic explanation of cache fusion mechanism 4)

Source: Internet
Author: User

Example 4: Write-to-read Transfer
The behavior of the write-to-read transfer is determined by the _ fairness_threshold parameter,
Which was introduced in Oracle 8.1.5 and defaults to 4. Prior to the introduction of this parameter,
When instance a held a block in exclusive mode and instance B requested a read-only copy of that
Block, instance a wowould downgrade its exclusive lock to a shared lock and send the block to instance B, which wowould also set a shared lock on the block.
Example 4: read/write Transmission
Read/write transmission performance depends on the _ fairness_threashold parameter, which appears from Oracle 8.1.5 and
The default value is 4. Before this parameter is introduced, when instance a holds this data block in exclusive mode, instance B requires
The read-only copy of this data block. At this time, instance 1 will be downgraded to the exclusive lock mode -- and the data block will be sent to instance B,
Instance B adds a shared lock to the data block.

However, if instance a is refreshing frequent updates on the block, it will need to reacquire the block and set an exclusive lock again. if this process is repeated frequently, then instance A will be continually interrupted, as it has to downgrade the exclusive lock to a shared lock and wait until instance B has finished reading the block before it can convert the shared lock back into an exclusive lock.
However, if instance a frequently performs new operations on the data block, it will need to re-obtain the data block and
Set the private shared lock again, so he must downgrade to share mode and wait for instance B until instance B is complete.
Read the data block, and then convert the data share lock to the locked mode.

The _ fairness_threshold parameter modifies this behavior. When this parameter is set,
Instance a will no longer downgrade the exclusive lock. Instead, it sends a null lock to instance B,
And then it can continue processing. However, if instance B requests the block _ fairness_threshold
Times, by default 4, then instance a will revert to the original behavior-it will downgrade
Exclusive lock to a shared lock and ship the block to instance B, which will also set a shared lock on
The block.

When the _ fairness_threashold parameter is set,
The instance will no longer downgrade the local private lock. Instead, it will send an empty lock to instance B, and then instance a will continue to do
Processing operation. However, if instance B requires that the number of data blocks reaches _ fairness_threahold,
The default value is four times. instance a will change the original practice-it will downgrade the private lock to the sharing mode and then transmit the data block to the instance
B. instance B will also set a shared lock for this data block.

This behavior is explained in the following example.
Instance 2 requests a current read on the block. instance 2 is not aware that the block is currently
Held by instance 4. instance 2 identifies that instance 3 is the resource master instance for the block
And sends amessage to instance 3 requesting shared access to the block (Figure 22-14 ).

This is explained in the following example:
Instance 2 needs to perform a read operation on the data block. Instance 2 does not know that this data block is held by instance 4 lock. Instance 2
3 is the resource owner of the data block. Therefore, a message is sent to instance 3, which requires a shared access to the data block.

Instance 3 checks in the GRD and discovers that the block is currently held by instance 4
Exclusive (update) access. instance 3 sends a message to instance 4 requesting that it sends the block
To instance 2 in Shared Mode (Figure 22-15 ).
Instance 3 checks GRD and finds that the data block is being held by instance 4 with a private lock. Instance 3 sends a message to instance 4, required
Instance 4 transmits data blocks to instance 2 in shared mode.

Instance 4 sends the block to instance 2 (Figure 22-16). Because the block has been requested
Less than _ fairness_threshold times, instance 4 retains the exclusive lock, and instance 2 es
A null lock.

Instance 4 transmits the data block to instance 2 ,. Because the number of times this data is quickly required is less than _ fairness_threshold
Number of times, instance 4 will retain the exclusive lock mode, and instance 2 will receive an empty lock.

 

 

 

Instance 2 has es the block and sends a message to instance 3 to update the resource status
(Figure 22-17). instance 3 updates the GRD. instance 2 assumes a null lock on the block and reads it.
Instance 4 can update the block for which it continues to hold an exclusive process.

Instance 2 receives the data block and sends a message to instance 3 to update the resource status. Instance 3 will follow the new GRD. Instance 2
Declare an empty lock for the data block and read it. At the same time, instance 4 can follow the new data block because it also holds
Private locks of data blocks.

 

 

 

 

The preceding process can be repeated the number of times specified by
_ Fairness_threshold parameter. By default, the value of this parameter is 4.
Instance 2 has now flushed the block from its buffer cache and needs to read it again. It sends
A read request to the Resource master, Which is instance 3 (Figure 22-18 ).
The preceding process can be repeated multiple times. The specific number of times is determined by the parameter _ fairness_threshold.
The default value of this parameter is 4. Instance 2 has now cleared the data blocks from the buffer cache, and requires
Read the data block again. It then sends the request to the resource owner, whose owner is instance 3.

Instance 3 (the Resource master) sends a message to instance 4 requesting that it sends a copy
Of the block to instance 2 (Figure 22-19). instance 4 notes that it has already sent the block
_ Fairness_threshold times to instance 2.

Instance 3 (resource owner) sends a message to instance 4, requiring it to send a copy of the data block to instance 2 ,. Instance 4 found,
You have sent the _ fairness_threshold message to instance 2.

 

 

 

Instance 4, therefore, downgrades the exclusive lock to a shared lock and sends the block
Instance 2 (Figure 22-20 ).

Therefore, instance 4 degrades the local private lock on the data block to the shared lock mode and sends the data block to instance 2.
Instance 2 es the block, assumes a shared lock, and sends amessage to instance 3
Update the resource status, setting the lock mode on the block to shared (Figure 22-21). instance 3
Updates the GRD.

Instance 2 receives the data block, claims a shared lock, and sends the resource information to instance 3 to check the status of the new resource,
Set the lock mode of the data block to share. Instance 3 is related to the new GRD information.

 

 

 

 

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.