Oracle Log Writer (LGWR) Writes Behavior On ASM – NORMAL And HIGH Redundancy Disk Groups
Sometime ago we had an internal discuss at Pythian about how LGWR writes are handled on ASM diskgroup configured with NORMAL or HIGH redundancy. Does LGWR waits for write acknowledgment from the writes on primary and secondary (mirror) extents? Some people had divided opinions.
If you think about it, it’s natural to wait for the write operations to complete on primary and secondary extents, otherwise what’s the point of having redundancy in the first place.
Imagine what would happen if disk where the first write happend experience failure and the system already retrieved confirmation of the write without writing to all fail-groups.
Test case:
I have 2 available partitioned disks /dev/sdd1 and /dev/sde1.
Let’s create device on top of /dev/sdd1 for which we will use dm_delay to delay writes for 5 seconds.
For IO delay I am using the delay option from dmsetup.
delay Delays reads and/or writes to different devices. Useful for testing
The new device will be created in /dev/mapper directory.
Next is to create ASM disks. I am using asmlib libraries. One ASM disk against newly created device with delayed IO and the other one against /dev/sde1 device.
Create the ASM diskgroup.
First let’s confirm log switch is fast.
Add logfile group to the new diskgroup.
Switch logfile for the new logfile group to become current.
Next is to test COMMIT.
As you can see COMMIT took almost 6 seconds to complete.