Tuesday, June 19, 2007

Mirroring

Lets share our knowledge on this one...

Currently I am trying to implement the mirroring. When I thought of implementing it, one thing just came across my mind, which one to implement 1) Volume mirroring 2) Disk mirroring - which are essentially the two types of implantation.

I started with Volume mirroring (with the help of Mayur).
Here are some points which one should keep in mind while implementing the same
(from Windows point of view...considering DDK kit)

Assumption
Source and target Volumes should be consistent

Ways to proceed
FIRSTLY do full format on source and target volumes
ELSE you need to write syncing code

Handling WRITE request
EITHER create a new IRP and redirect it to target volume (but this will require a sound knowledge on drivers)
OR just manually write the data on target volume using the information available in IRP (meta-data)

2nd inning
Now if you are thinking of handling write request manually then people will suggest that to let you original WRITE requests to complete, in mean time log the necessary information on scratch-pad (NOTE: scratch-pad info should be complete enough so that later on you can create your READ request for the same data-buffer using your info) Generate a READ request and write the retrieve data on the target volume. This will not hamper any performance as you are not wasting much time in WRITE request (you just log necessary information on scratch-pad thats all) and much important is, if write fails you can just remove the scratch-pad entry in contrast to other approach where default WRITE request may fail and then you are in trouble :-)your another WRITE request to target volume may have completed successfully.

Now your target volume is replica :-) So try to implement the things....in case of doubts post your opinion...

3 comments:

Aniket said...

Hey, put your thoughts, views, concerns....we are here to share knowledge :)

Chetan Pathak said...

You are right about the knowledge sharing dude .... but some of us (like me) need a bit of time before we can discuss implementing anything on a Windows platform :-p

Just a few doubts to start off though .......
* If we are assuming that the source and target volumes are consistent, then why do we need a mirroring infrastructure ??
* What is an IRP ?
* Why is the 2nd inning a second inning, rather, what is the 1st inning ? :-p
* Is the scratch-pad in any manner similar to Journaling ?
* Is Volume Mirroring in any manner similar to RAIF ?

Looking forward to your and the others comments :-)

Aniket said...

So, discussion has begun...with doubts...of course :D Let’s gather for sharing some thoughts on this one as many of us (including me) don't know this area in much detail.

I have realized that I wrote this blog totally implementation point of view rather than explaining the concept of mirroring. But during that point of time I thought anyone can Google for mirroring and can obtain the actual concepts. So I thought that I should write something which will be more useful – thus included some points that one should take care before implementing mirroring through WDD (WDD people might easily get what I mentioned before).
Anyways we have expertise here and this discussion will definitely contribute to the conception of Mirroring :D

I will start the discussion with answers to the questions…

* Assumption – The one I was talking about is regarding the similarities between the source and target volumes i.e. both should be identical in all aspects (data, space capacity, file system mounted etc) before starting your mirror driver utility. By chance, if you missed out any of this similarity then prepare to take the extra efforts for ensuring synchronization between two volumes (apologies for using the word 'consistent' previously, which have created misconception :D )

* IRP - I/O Request Packet. Here comes into picture the layered kernel architecture of Windows.
An IRP is the basic I/O Manager structure used to communicate with drivers and to allow drivers to communicate with each other.

* 2nd inning – Is actually a second approach mentioned under 'Handling WRITE request'. And this 2nd inning is quiet difficult to implement :D Thus, I have mentioned some simple points for approaching the same.

* Scratch-pad - Yes, you are correct. It’s a journal and by using it you can rebuild the I/O requests.

* RAIF - It’s a good question! As I understand, Volume Mirroring is similar to RAIF from implementation point of view, but conceptually I don’t know this in detail. Chetan, please take this opportunity to explain RAIF

Chetan thanks for the reply!