All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ronnie Lazar <ronnie.lazar@vastdata.com>
To: linux-raid@vger.kernel.org
Cc: Asaf Levy <asaf@vastdata.com>
Subject: Question about potential data consistency issues when writes failed in mdadm raid1
Date: Wed, 15 Mar 2023 20:06:42 +0200	[thread overview]
Message-ID: <CALM_6_s7=eyDWFkirzg6ifqeeeF6-bnZD8n7=3=V+fm_qc34AQ@mail.gmail.com> (raw)

Hi,

I'm trying to understand how mdadm protects against inconsistent data
read in the face of failures that occur while writing to a device that
has raid1.
Here is the scenario:
I have set up raid1 that has 2 mirrors. First one is on local storage
and the second is on remote storage.  The remote storage mirror is
configured with write-mostly.

We have parallel jobs: 1 writing to an area on the device and the
other reading from that area.
The write operation writes the data to the first mirror, and at that
point the read operation reads the new data from the first mirror.
Now, before data has been written to the second (remote) mirror a
failure has occurred which caused the first machine to fail, When the
machine comes up, the data is recovered from the second, remote,
mirror.

Now when reading from this area, the users will receive the older
value, even though, in the first read they got the newer value that
was written.

Does mdadm protect against this inconsistency?

Regards,
Ronnie Lazar

             reply	other threads:[~2023-03-15 18:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 18:06 Ronnie Lazar [this message]
2023-03-17 20:58 ` Question about potential data consistency issues when writes failed in mdadm raid1 John Stoffel
2023-03-19  9:13   ` Asaf Levy
2023-03-19  9:55     ` Geoff Back
2023-03-19 11:31       ` Asaf Levy
2023-03-19 12:45         ` Geoff Back
2023-03-19 14:34           ` Asaf Levy
2023-03-20 13:52         ` John Stoffel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALM_6_s7=eyDWFkirzg6ifqeeeF6-bnZD8n7=3=V+fm_qc34AQ@mail.gmail.com' \
    --to=ronnie.lazar@vastdata.com \
    --cc=asaf@vastdata.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.