On Thursday June 1, [EMAIL PROTECTED] wrote:
> > -----Original Message-----
> > From: Luca Berra [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 01, 2000 11:24 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: how should I set up swap?
> > 
> > On Thu, Jun 01, 2000 at 04:26:24PM +0100, Corin Hartland-Swann wrote:
> > > The solution I used (for maximum resilience) was to put a 
> > swap /file/ on
> > > the RAID-1 root (instead of a seperate partition). This 
> > gets around the
> > > problem of using swap during reconstruction, IIRC because swap works
> > > slightly differently on a file rather than on a device. 
> > There is a small
> > > speed penalty, but much better resiliancy.
> > 
> > NO, it does not, the problem is still there whether you swap 
> > on file or on
> > partition, sorry
> 
> Can somebody explain what the problem is, and why it's a problem, and all
> that Jazz, or point to the archives and give us a hint as to what the
> subject line is so that we can find an archive of the lists and find it
> ourself?
>       Greg

The problem is that, during rebuild, the raid subsystem:

   Reads data into the buffer cache
and
   Writes that data out again - onto the disc(s) being rebuilt.

At the same time, the swap subsystem is writting to the RAID array
*NOT* through the buffer cache.

So you can get:
   1/ raid read a block into buffer cache
   2/ swap over-rights that block during swap-out
   3/ raid writes the old, buffered block out to disc.

This will cause the disc that was being rebuilt to have *wrong* data.
If, after the rebuild completes, the swap subsystem wants that data
back, and by luck gets it from the newly rebuilt disc, it will get
wrong data.

Now the chance of all this happening is fairly remote.  But would you
want to trust your data to it?

This, ofcourse, means not only that you must delay "swap-on" until
rebuild has completed, but also that you cannot have a hot spare.

Note:
  In 2.2 all filesystems go through the buffer cache, so they don't
  have a problem.  Only swap doesn't and it doesn't whether you are
  swapping to a device or to a file.
  In 2.3, the buffer cache is largely sidelined in favour of the page
  cache, and this is, in part, why the rebuild code is totally
  different in 2.3.99pre8+

NeilBrown

Reply via email to