]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: restore jerasure BlaumRoth default w 2556/head
authorLoic Dachary <loic-201408@dachary.org>
Tue, 23 Sep 2014 09:11:59 +0000 (11:11 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 23 Sep 2014 09:42:47 +0000 (11:42 +0200)
Changing from W=7 to W=6 by default for the BlaumRoth technique is
correct but introduces a regression. The content that was encoded with
the previous version cannot be read again. Although the prime(w+1)
constraint was not obeyed by W=7, the encoded content was useable and
should keep being readable.

The W=7 remains the default for backward compatibility and an exception
to the prime(w+1) check.

http://tracker.ceph.com/issues/9572 Fixes: #9572

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/erasure-code/jerasure/ErasureCodeJerasure.cc
src/erasure-code/jerasure/ErasureCodeJerasure.h

index d48e0dbe44e3015aa8ea2be3466d979a4014b095..4cac0a5f11ad562b10ed06abaef31b70058752dc 100644 (file)
@@ -454,6 +454,10 @@ void ErasureCodeJerasureLiberation::prepare()
 //
 bool ErasureCodeJerasureBlaumRoth::check_w(ostream *ss) const
 {
+  // back in Firefly, w = 7 was the default and produced useable 
+  // chunks. Tolerate this value for backward compatibility.
+  if (w == 7)
+    return true;
   if (w <= 2 || !is_prime(w+1)) {
     *ss <<  "w=" << w << " must be greater than two and "
        << "w+1 must be prime" << std::endl;
index 4a3b337a11b98a8ab4acd7c3b67ad0063c762ed2..d40a03dec88ec0e611f2cc3a0d7735f95a56c596 100644 (file)
@@ -236,7 +236,6 @@ public:
   ErasureCodeJerasureBlaumRoth() :
     ErasureCodeJerasureLiberation("blaum_roth")
   {
-    DEFAULT_W = 6;
   }
 
   virtual bool check_w(ostream *ss) const;