All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Dunlop <chris@onthe.net.au>
To: Allen Samuels <Allen.Samuels@sandisk.com>
Cc: Sage Weil <sage@newdream.net>,
	Igor Fedotov <ifedotov@mirantis.com>,
	ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: Adding compression/checksum support for bluestore.
Date: Sat, 2 Apr 2016 15:07:37 +1100	[thread overview]
Message-ID: <20160402040736.GA22721@onthe.net.au> (raw)
In-Reply-To: <CY1PR0201MB1897EE2E58FFF2FF3DFFFB55E89A0@CY1PR0201MB1897.namprd02.prod.outlook.com>

On Fri, Apr 01, 2016 at 11:08:35PM +0000, Allen Samuels wrote:
>> -----Original Message-----
>> From: Chris Dunlop [mailto:chris@onthe.net.au]
>> Sent: Friday, April 01, 2016 12:49 PM
>> To: Sage Weil <sage@newdream.net>
>> Cc: Allen Samuels <Allen.Samuels@sandisk.com>; Igor Fedotov
>> <ifedotov@mirantis.com>; ceph-devel <ceph-devel@vger.kernel.org>
>> Subject: Re: Adding compression/checksum support for bluestore.
>> 
>> On Fri, Apr 01, 2016 at 10:58:17AM -0400, Sage Weil wrote:
>>> On Fri, 1 Apr 2016, Chris Dunlop wrote:
>>>> On Fri, Apr 01, 2016 at 12:56:48AM -0400, Sage Weil wrote:
>>>>> On Fri, 1 Apr 2016, Chris Dunlop wrote:
>>>>>> On Wed, Mar 30, 2016 at 10:52:37PM +0000, Allen Samuels wrote:
>>>>>>> One thing to also factor in is that if you increase the span of a
>>>>>>> checksum, you degrade the quality of the checksum. So if you go with
>>>>>>> 128K chunks of data you'll likely want to increase the checksum
>>>>>>> itself from something beyond a CRC-32. Maybe somebody out there has
>>>>>>> a good way of describing this quanitatively.
>>>>>>
>>>>>> I would have thought the "quality" of a checksum would be a function
>>>>>> of how many bits it is, and how evenly and randomly it's distributed,
>>>>>> and unrelated to the amount of data being checksummed.
>>>>>>
>>>>>> I.e. if you have any amount of data covered by an N-bit evenly
>>>>>> randomly distributed checksum, and "something" goes wrong with the
>>>>>> data (or the checksum), the chance of the checksum still matching the
>>>>>> data is 1 in 2^n.
>>>>>
>>>>> Say there is some bit error rate per bit. If you double the amount of
>>>>> data you're checksumming, then you'll see twice as many errors. That
>>>>> means that even though your 32-bit checksum is right 2^32-1 times out
>>>>> of 2^32, you're twice as likely to hit that 1 in 2^32 chance of
>>>>> getting a correct checksum on wrong data.
>>>>
>>>> It seems to me, if we're talking about a single block of data protected
>>>> by a 32-bit checksum, it doesn't matter how many errors there are
>>>> within the block, the chance of a false checksum match is still
>>>> only 1 in 2^32.
>>>
>>> It's not a question of how many errors are in the block, it's a question
>>> of whether there are more than 0 errors. If the bit error rate is so
>>> low it's 0, our probability of a false positive is 0, no matter how many
>>> blocks there are. So for a bit error rate of 10e-15, then it's 10e-15 *
>>> 1^-32. But if there are 1000 bits in a block, it becomes 10e-12 *
>>> 1^-32.
>>>
>>> In other words, we're only rolling the checksum dice when there is
>>> actually an error, and larger blocks are more likely to have errors. If
>>> your blocks were so large you were effectively guaranteed to have an
>>> error in every one, then the effective false positive rate would be
>>> exactly the checksum false positive rate (2^-32).
>> 
>> Good point, I hadn't thought about it like that. But that's the "single
>> block" case. On the other hand, a large storage system is the same case
>> as the stream of blocks: for a given storage (stream) size, your chance
>> of hitting an error is constant, regardless of the size of the individual
>> blocks within the storage. Then, if/when you hit an error, the chance of
>> getting a false positive on the checksum is a function of the checksum
>> bits and independent of the block size.
> 
> I think we're getting confused about terminology. What matters isn't
> "blocks" but the ratio of bits of checksum to bits of data covered by that
> checksum. That ratio determines the BER of reading that data and hence the
> overall system. If you double the amount of data you need to add 1 bit of
> checksum to maintain the same BER.

The "blocks" we're talking about in this context are the data bits covered
by the checksum bits. I.e. we're talking about the same thing there.

But perhaps you're correct about confusion of terminology... we're talking
about checksums, not error correcting codes, right?

An ECC can fix errors and thus reduce the observable BER, and indeed the
more ECC bits you have, the lower the observable BER because a greater range
of errors can be fixed.

But checksums no effect on the BER. If you have an error, the checksum tells
you (hopefully!) "you have an error".

What I think we're talking about is, if you have an error, the probability
of the checksum unfortunately still matching, i.e. a false positive: you
think you have good data but it's actually crap. And that's a function of
the number of checksum bits, and unrelated to the number of data bits. Taken
to extremes, you could have a 5PB data system covered by a single 32 bit
checksum, and that's no more or less likely to give you a false positive
than a 32 bit checksum on a 4K block, and it doesn't change the BER at all.

That said, if you have to throw away 5PB of data and read it again because
of a checksum mismatch, your chances of getting another error during the
subsequent 5PB read are obviously much higher than your chances of getting
another error during a subsequent 4KB read.

Perhaps this is the effect you're thinking about? However this effect is a
function of the block size (== data bits) and is independent of the checksum
size.

> I started this discussion in reaction to Sage's observation that we could
> reduce the checksum storage overhead by checksuming larger blocks. My
> point is that this will degrade the BER of system accordingly. That's
> neither good nor bad, but it's something that will matter to people. If
> you go from a 4K chunk of data with, say a 32-bit checksum to a 128K chunk
> of data with the same 32-bit checksum, then you simply have to accept that
> the BER is reduced by that ratio (4K / 128K) OR you have to move to
> checksum value that has 32 more bits in it (128K/4K). Whether that's
> acceptable is a user choice.
>
> I think it's good to parameterize the checksum algorithms and checksumming
> block size. All we need to do is to document the system level effects,
> etc., and give people guidance on how to connect these settings with the
> magnitude of data under management (which matters) and the HW UBER (which
> may vary A LOT from device to device).

I agree it's good to parametrize these aspects to provide people with
choice. However I also think it's important that people correctly understand
the choices being made. 

Chris

  parent reply	other threads:[~2016-04-02  4:07 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 19:46 Adding compression/checksum support for bluestore Allen Samuels
2016-03-30 20:41 ` Vikas Sinha-SSI
2016-03-30 22:24   ` Sage Weil
2016-03-30 22:35     ` Allen Samuels
2016-03-31 16:31   ` Igor Fedotov
2016-03-30 22:15 ` Sage Weil
2016-03-30 22:22   ` Gregory Farnum
2016-03-30 22:30     ` Sage Weil
2016-03-30 22:43       ` Allen Samuels
2016-03-30 22:32   ` Allen Samuels
2016-03-30 22:52   ` Allen Samuels
2016-03-30 22:57     ` Sage Weil
2016-03-30 23:03       ` Gregory Farnum
2016-03-30 23:08         ` Allen Samuels
2016-03-31 23:02       ` Milosz Tanski
2016-04-01  3:56     ` Chris Dunlop
2016-04-01  4:56       ` Sage Weil
2016-04-01  5:28         ` Chris Dunlop
2016-04-01 14:58           ` Sage Weil
2016-04-01 19:49             ` Chris Dunlop
2016-04-01 23:08               ` Allen Samuels
2016-04-02  2:23                 ` Allen Samuels
2016-04-02  2:51                   ` Gregory Farnum
2016-04-02  5:05                     ` Chris Dunlop
2016-04-02  5:48                       ` Allen Samuels
2016-04-02  6:18                       ` Gregory Farnum
2016-04-03 13:27                         ` Sage Weil
2016-04-04 15:33                           ` Chris Dunlop
2016-04-04 15:51                             ` Chris Dunlop
2016-04-04 17:58                               ` Allen Samuels
2016-04-04 15:26                         ` Chris Dunlop
2016-04-04 17:56                           ` Allen Samuels
2016-04-02  5:08                     ` Allen Samuels
2016-04-02  4:07                 ` Chris Dunlop [this message]
2016-04-02  5:38                   ` Allen Samuels
2016-04-04 15:00                     ` Chris Dunlop
2016-04-04 23:58                       ` Allen Samuels
2016-04-05 12:35                         ` Sage Weil
2016-04-05 15:10                           ` Chris Dunlop
2016-04-06  6:38                             ` Chris Dunlop
2016-04-06 15:47                               ` Allen Samuels
2016-04-06 17:17                                 ` Chris Dunlop
2016-04-06 18:06                                   ` Allen Samuels
2016-04-07  0:43                                     ` Chris Dunlop
2016-04-07  0:52                                       ` Allen Samuels
2016-04-07  2:59                                         ` Chris Dunlop
2016-04-07  9:51                                           ` Willem Jan Withagen
2016-04-07 12:21                                             ` Atchley, Scott
2016-04-07 15:01                                               ` Willem Jan Withagen
2016-04-07  9:51                                           ` Chris Dunlop
2016-04-08 23:16                                             ` Allen Samuels
2016-04-05 20:41                           ` Allen Samuels
2016-04-05 21:14                             ` Sage Weil
2016-04-05 12:57                         ` Dan van der Ster
2016-04-05 20:50                           ` Allen Samuels
2016-04-06  7:15                             ` Dan van der Ster
2016-03-31 16:27   ` Igor Fedotov
2016-03-31 16:32     ` Allen Samuels
2016-03-31 17:18       ` Igor Fedotov
2016-03-31 17:39         ` Piotr.Dalek
2016-03-31 18:44         ` Allen Samuels
2016-03-31 16:58 ` Igor Fedotov
2016-03-31 18:38   ` Allen Samuels
2016-04-04 12:14     ` Igor Fedotov
2016-04-04 14:44       ` Allen Samuels

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=20160402040736.GA22721@onthe.net.au \
    --to=chris@onthe.net.au \
    --cc=Allen.Samuels@sandisk.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=ifedotov@mirantis.com \
    --cc=sage@newdream.net \
    /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.