]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: ECRecPred must be true if all chunks can be recovered 1921/head
authorLoic Dachary <loic-201408@dachary.org>
Wed, 27 Aug 2014 15:05:02 +0000 (17:05 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Fri, 29 Aug 2014 17:39:57 +0000 (19:39 +0200)
commit45a61ad6b30d71790ce7a02d9b7210a62defffa0
tree8f51ad83de9b211e793ceec71dee4252d9a1936d
parent734ae88ef0560e259056d06e45b820fb55537f8e
erasure-code: ECRecPred must be true if all chunks can be recovered

ECRecPred assumes recovering any number of chunk is possible as long as
at least K chunks are available. It builds the want() set accordingly in
the constructor and arbitrarily set the first K chunks. But it would be
the same if it set the last K chunks.

While this is correct for jerasure and isa plugins, it is not true in
general. The predicate should assume that all chunks are going to be
recovered and return true if they can all be recovered. Otherwise, the
following can happen:

  * a PG has chunks 0,1,2,3 for K=2, M=2
  * ECRecPred is initialized a set want to 0,1 because K=2
  * ECRecPred claims the plugin can recover when provided 0,1
  * the plugin is then required to recover 0,1 using 2,3 and fails

This can happen for the LRC plugin with k=4,m=2,l=3 which is

  01234567
  DDc_DDc_
  DDDc____
  ____DDDc

and if chunks 0,1,2,3 are missing there is no way to recover chunks
4,5,6,7.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/osd/ECBackend.h