All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Chris Murphy <lists@colorremedies.com>,
	Tomasz Torcz <tomek@pipebreaker.pl>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [BUG] Btrfs scrub sometime recalculate wrong parity in raid5
Date: Wed, 21 Sep 2016 20:44:33 -0600	[thread overview]
Message-ID: <CAJCQCtQMZFnHhD0v0Qtwyh=MgeiMZjuWODY5unVLSVEUQMNYDQ@mail.gmail.com> (raw)
In-Reply-To: <ac57e4db-dc9f-938f-9711-0c6d44d66d67@cn.fujitsu.com>

On Wed, Sep 21, 2016 at 8:08 PM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>
>
> At 09/21/2016 11:13 PM, Chris Murphy wrote:

>> I understand some things should go in fsck for comparison. But in this
>> case I don't see how it can help. Parity is not checksummed. The only
>> way to know if it's wrong is to read all of the data strips, compute
>> parity, and compare in-memory parity from current read to on-disk
>> parity.
>
>
> That's what we plan to do.
> And I don't see the necessary to csum the parity.
> Why csum a csum again?

parity!=csum


http://www.spinics.net/lists/linux-btrfs/msg56602.html



>> There is already an offline scrub in btrfs
>> check which doesn't repair, but also I don't know if it checks parity.
>>
>>        --check-data-csum
>>            verify checksums of data blocks
>
>
> Just as you expected, it doesn't check parity.
> Even for RAID1/DUP, it won't check the backup if it succeeded reading the
> first stripe.

Both copies are not scrubbed? Oh hell...

[chris@f24s ~]$ sudo btrfs scrub status /brick2
scrub status for 7fea4120-9581-43cb-ab07-6631757c0b55
    scrub started at Tue Sep 20 12:16:18 2016 and finished after 01:46:58
    total bytes scrubbed: 955.93GiB with 0 errors

How can this possibly correctly say 956GiB scrubbed if it has not
checked both copies? That message is saying *all* the data, both
copies, were scrubbed. You're saying that message is wrong? It only
scrubbed half that amount?

[chris@f24s ~]$ sudo btrfs fi df /brick2
Data, RAID1: total=478.00GiB, used=477.11GiB
System, RAID1: total=32.00MiB, used=96.00KiB
Metadata, RAID1: total=2.00GiB, used=877.59MiB
GlobalReserve, single: total=304.00MiB, used=0.00B


When that scrub was happening, both drives were being accessed at 100%
throughput.







>
> Current implement doesn't really care if it's the data or the copy
> corrupted, any data can be read out, then there is no problem.
> The same thing applies to tree blocks.
>
> So the ability to check every stripe/copy is still quite needed for that
> option.
>
> And that's what I'm planning to enhance, make --check-data-csum to kernel
> scrub equivalent.

OK thanks.


>
>>
>>            This expects that the filesystem is otherwise OK, so this
>> is basically and
>>            offline scrub but does not repair data from spare coipes.
>
>
> Repair can be implemented, but maybe just rewrite the same data into the
> same place.
> If that's a bad block, then it can't repair further more unless we can
> relocate extent to other place.

Any device that's out of reserve sectors and can no longer remap LBA's
on its own, is a drive that needs to be decommissioned. It's a new
feature in just the last year or so that mdadm has a badblocks map so
it can do what the drive won't do, but I'm personally not a fan of
keeping malfunctioning drives in RAID.


>
>>
>> Is it possible to put parities into their own tree? They'd be
>> checksummed there.
>
>
> Personally speaking, this is quite a bad idea to me.
> I prefer to separate different logical layers into their own codes.
> Not mixing them together.
>
> Block level things to block level(RAID/Chunk), logical thing to logical
> level(tree blocks).

OK.

>
> Current btrfs csum design is already much much better than pure RAID.
> Just think of RAID1, while one copy is corrupted, then which copy is correct
> then?

Yes.


-- 
Chris Murphy

  reply	other threads:[~2016-09-22  2:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25 12:21 [BUG] Btrfs scrub sometime recalculate wrong parity in raid5 Goffredo Baroncelli
2016-06-25 17:25 ` Chris Murphy
2016-06-25 17:58   ` Chris Murphy
2016-06-25 18:42     ` Goffredo Baroncelli
2016-06-25 22:33       ` Chris Murphy
2016-06-26  9:20         ` Goffredo Baroncelli
2016-06-26 16:43           ` Chris Murphy
2016-06-26  2:53   ` Duncan
2016-06-26 22:33     ` ronnie sahlberg
2016-06-26 22:38       ` Hugo Mills
2016-06-27  3:22         ` Steven Haigh
2016-06-27  3:21       ` Steven Haigh
2016-06-27 19:47         ` Duncan
2016-06-27  3:50       ` Christoph Anton Mitterer
2016-06-27  4:35         ` Andrei Borzenkov
2016-06-27 16:39           ` Christoph Anton Mitterer
2016-09-21  7:28 ` Qu Wenruo
2016-09-21  7:35   ` Tomasz Torcz
2016-09-21  9:15     ` Qu Wenruo
2016-09-21 15:13       ` Chris Murphy
2016-09-22  2:08         ` Qu Wenruo
2016-09-22  2:44           ` Chris Murphy [this message]
2016-09-22  3:00             ` Qu Wenruo
2016-09-22  3:12               ` Chris Murphy
2016-09-22  3:07           ` Christoph Anton Mitterer
2016-09-22  3:18             ` Qu Wenruo
2016-09-21 15:02   ` Chris Murphy
2016-11-04  2:10 ` Qu Wenruo
2016-11-05  7:23   ` Goffredo Baroncelli
2016-07-12 21:50 [BUG] Btrfs scrub sometime recalculate wrong parity in raid5: take two Goffredo Baroncelli
2016-07-16 15:51 ` [BUG] Btrfs scrub sometime recalculate wrong parity in raid5 Jarkko Lavinen
2016-07-17 19:46   ` Jarkko Lavinen
2016-07-18 18:56   ` Goffredo Baroncelli
2016-08-19 13:17 Philip Espunkt

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='CAJCQCtQMZFnHhD0v0Qtwyh=MgeiMZjuWODY5unVLSVEUQMNYDQ@mail.gmail.com' \
    --to=lists@colorremedies.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    --cc=tomek@pipebreaker.pl \
    /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.