1756639 Members
2430 Online
108849 Solutions
New Discussion юеВ

Mirror

 
SOLVED
Go to solution
Roberto Volsa
Frequent Advisor

Mirror

Simple question: for a standard mirrored LV, the writing on the two PEs is performed at the same time or there is a delay between the writing on the 2 disks?
If there is a crash; the consistency between the two copies is guaranteed?
Is it possible to change the writing politics to the 2 PEs?

Thanks a lot

Roberto
8 REPLIES 8
Jean-Louis Phelix
Honored Contributor

Re: Mirror

Hi,

By default, PEs are written in parallel mode. You can change it to sequential by using 'lvchange -d s'. In case of crash, lvm tries to resynchronize all PEs.

Regards.
It works for me (┬й Bill McNAMARA ...)
RAC_1
Honored Contributor

Re: Mirror

I think we have some control over this. Do not have a system at hand at the moment.

If my memory serves me right, check manpage for vgcreate. It has got some option for this.
There is no substitute to HARDWORK
Bernhard Mueller
Honored Contributor

Re: Mirror

Roberto,

that is what the "Mirror Write Cache" is for. By default it is enabled and guarantees consistency.

It allows LVM to determine whether all the mirror copies are identical, even across system crashes.

You can switch it off with lvcreate using "-M n". Then you are save only for deactivting the vg and re-activating, not across a crash.

You can switch consistency recovery off with lvcreate using "-c n". In which case I'd have to ask you why you do mirroring at all .... ;-)

Regards,
Bernhard
John Palmer
Honored Contributor

Re: Mirror

Default is parallel writes, you can change this with the -d flag of lvcreate/lvchange.

man lvcreate for info, note the warning about performance if you set schedule to sequential!

Consistency after a crash is influenced by the -c and -M flags.

Regards,
John
RAC_1
Honored Contributor

Re: Mirror

It is lvcreate/lvchange

man lvcreate/lvchange
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: Mirror

The default mode is parallel but you can select sequential update policy. You are trading off speed for reliability. In practice, there is very little reason to use the sequential update policy because 1) the latency introduced by the UNIX buffer cache and 2) the on-disk cache. Note that even in the case of the write being sent to disk really only means that it got to the disk's on-board buffer rather than written to the disk.
If it ain't broke, I can fix that.
James Lynch
Valued Contributor

Re: Mirror

What Clay is referring to is "Immediate Disk Reporting". This is a feature found in most modern disk drives. For those that are really paranoid, this capability can be disabled. Disabling this feature is NOT reccomended due to the significant performance hit that results.

JL
Wild turkey surprise? I love wild turkey surprise!