All of lore.kernel.org
 help / color / mirror / Atom feed
* DM-RAID1 data corruption
@ 2009-04-14 20:46 Mikulas Patocka
  2009-04-14 21:07 ` Takahiro Yasui
  2009-04-15  3:12 ` malahal
  0 siblings, 2 replies; 16+ messages in thread
From: Mikulas Patocka @ 2009-04-14 20:46 UTC (permalink / raw)
  To: Alasdair G Kergon; +Cc: Heinz Mauelshagen, dm-devel

Hi

This is the scenario of data corruption that I was talking about:

Mirror has two legs, 0 and 1 and a log. Disk 0 is the default.

A write is propagated to both legs. The write fails on leg 0 and succeeds 
on leg 1.

The function "write_callback" puts the bio to "failure" list (if 
errors_handled was true). It also wakes userspace.

do_failures pops the bios from ms->log_failure and calls dm_rh_mark_nosync 
on them to mark the region nosync. dm_rh_mark_nosync completes the bio 
with success.

*the computer crahes* (before the userspace daemon had a chance to run)

On next reboot, disk is 0 revived (suppose that it temporarily failed 
because of a loose cable, overheating, insufficient power or so, and the 
condition is repaired), raid1 sees set bit in the dirty bitmap and starts 
copying data from disk 0 to disk 1.

The result: write bio was ended as succes, but the data was lost. For 
databases, this might have bad consequences - committed transactions being 
forgotten.

-

If the above scenario can't happen, pls. describe why.

What would be a possible way to fix this?

Delay all bios until the userspace code removes the failed mirror?
Or store the number of the default mirror in the log?

Mikulas

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-06-25 16:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 20:46 DM-RAID1 data corruption Mikulas Patocka
2009-04-14 21:07 ` Takahiro Yasui
2009-04-15  3:12 ` malahal
2009-04-15 20:38   ` Takahiro Yasui
2009-04-16  2:49     ` malahal
2009-04-16 22:24       ` Takahiro Yasui
2009-04-20  9:56         ` Mikulas Patocka
2009-04-20 17:08           ` Takahiro Yasui
2009-05-27  1:33           ` malahal
2009-06-23  1:09           ` malahal
2009-06-23 16:44             ` Takahiro Yasui
2009-06-23 18:22               ` malahal
2009-06-24  3:03               ` Neil Brown
2009-06-24 16:09                 ` Takahiro Yasui
2009-06-25 14:47                   ` Mikulas Patocka
2009-06-25 16:16                     ` Takahiro Yasui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.