it actually doesn't assert the value
becase we now use same if statement
for the assertion but hope it to be
even a little better than no covarage.
Change-Id: I8860a2a8227e43e02afddcbad1e108157c0872f6
...if users *really* want to. They opt-in at run time by setting
LIBERASURECODE_WRITE_LEGACY_CRC=1
in the environment; leaving it unset, set to an empty string, or set to
the string "0" continues to write zlib crcs.
UpgradeImpact
=============
This option is intended to allow a smooth upgrade from liberasurecode
1.5.0 and earlier in a system with multiple readers and writers:
* Before upgrade, ensure the environment variable is set on all nodes.
This will be ignored by earlier versions.
* Upgrade liberasurecode on each node in the system, restarting any
services that use it. Every node continues writing CRCs that are
still usable by nodes that have not yet upgraded.
* Now that every node is capable of reading zlib CRCs, remove the
environment variable from each node to start writing new CRCs.
If you are already using 1.6.0 or later, just upgrade normally.
Closes-Bug: #1886088
Closes-Bug: #1867937
Related-Bug: #1666320
Needed-By: https://review.opendev.org/#/c/739164/
Change-Id: I9adfbe631a2dddc592fd08f8a325f3e8331b92f1
... and vice-versa. We'll fix up frag header values for our output
parameter from liberasurecode_get_fragment_metadata but otherwise
avoid manipulating the in-memory fragment much.
Change-Id: Idd6833bdea60e27c9a0148ee28b4a2c1070be148
Otherwise, we're left with error-prone copy & pasting, which means we'll
constantly be cleaning it up.
Change-Id: I57e2cbef2c9221cffccf2e73b6af9bd003c04968
Related-Change: Ibd72ba4ae609ad77e8808aa1594b0adb62e34ef0
Related-Change: I9ee9ec3d8f86a10c4c7b5d6425a530b9c44d1156
* When we specify a particular backend, we don't need to include it in
the display string; we'll already include it in the output.
* test_destroy_backend_invalid_args shouldn't be reported as
test_create_backend_invalid_args.
* Consistently include the leading "test_" in the display string.
Change-Id: Ibd72ba4ae609ad77e8808aa1594b0adb62e34ef0
Each was only really used in one place, they had some strange return types,
and recent versions of clang on OS X would refuse to compile with
erasurecode_helpers.c:531:26: error: taking address of packed member 'metadata_chksum' of
class or structure 'fragment_header_s' may result in an unaligned pointer value
[-Werror,-Waddress-of-packed-member]
return (uint32_t *) &header->metadata_chksum;
^~~~~~~~~~~~~~~~~~~~~~~
We don't really *care* about the pointer; we just want the value!
Change-Id: I8a5e42312948a75f5dd8b23b6f5ccfa7bd22eb1d
Previously, we had our own CRC that was almost but not quite like
zlib's implementation. However,
* it hasn't been subjected to the same rigor with regard to error-detection
properties and
* it may not even get used, depending upon whether zlib happens to get
loaded before or after liberasurecode.
Now, we'll use zlib's CRC-32 when writing new frags, while still
tolerating frags that were created with the old implementation.
Change-Id: Ib5ea2a830c7c23d66bf2ca404a3eb84ad00c5bc5
Closes-Bug: 1666320
Currently, there are several implementations of erasure codes that are
available within OpenStack Swift. Most, if not all, of which are based
on the Reed Solomon coding algorithm.
Phazr.IO’s Erasure Coding technology uses a patented algorithm which are
significantly more efficient and improves the speed of coding, decoding
and reconstruction. In addition, Phazr.IO Erasure Code use a non-systematic
algorithm which provides data protection at rest and in transport without
the need to use encryption.
Please contact support@phazr.io for more info on our technology.
Change-Id: I4e40d02a8951e38409ad3c604c5dd6f050fa7ea0
It uses hard-coded backend and arguments, so it should use EC_BACKEND_MAX
and have a name that reflect how it's only targeted to Jerasure.
This is similar to how we handled the targeted test case for ISA-L.
Change-Id: I0a397930b2f49c0775290970c820bc70310a475e
Can you believe that we ware testing the memory leak with valgrind
to just *bash scripts* instead of actual binaries on liberasurecode_test
and libec_slap?
That is why we cannot find such an easy memory leak[1] at the gate.
Now this patch enable to run the valgrind against to the binaries.
With this fix, we found various memory leak at liberasurecode_test as
follows and this patch also fixes them:
- If we create fake fragments, we're responsible for freeing all of the
frags as well as the array holding the pointers to the frags.
- If we allocate any space, we're responsible for freeing it.
- If we create an EC descriptor, we're responsible for destroying it.
- If we create a fragment or skip array, we're responsible for freeing it.
- If that happens inside a loop, we're responsible for doing it *inside
that same loop*.
In addition to the test fix, this patch fixes following memory leaks at
the code which is affected to other users (pyeclib, OpenStack Swift)
* Refuse to decode fragments that aren't even long enough to include
fragment headers.
* Fix a small memory leak in the builtin rs_vand implementation.
Closes-Bug: #1665242
Co-Authored-By: Tim Burke <tim@swiftstack.com>
1: https://review.openstack.org/#/c/431812
Change-Id: I96f124e4e536bbd7544208acc084de1cda5c19b2
This is for supporting ISA-L cauchy based matrix. The difference
from isa_l_rs_vand is only the matrix to use the encode/decode calculation.
As a known issue, isa_l_rs_vand backend has constraint for the
combinations of the available fragment to be able to decode/reconstuct.
(See related change in detail)
To avoid the constraint, this patch adds another isa-l backend to use
cauchy matrix and keep the backward compatibility, this is in
another isa_l_rs_cauchy namespace.
For implementation consieration, the code is almost same except the matrix
generation fucntion so that this patch makes isa_l_common.c file for
gathering common fucntions like init/encode/decode/reconstruct. And then the
common init funciton takes an extra args "gen_matrix_func_name" for entry
point to load the fucntion by dlsym from isa-l .so file.
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Related-Change: Icee788a0931fe692fe0de31fabc4ba450e338a87
Change-Id: I6eb150d9d0c3febf233570fa7729f9f72df2e9be
Currently, we have liberasurecode version info in the header and pyeclib
is using the info to detect the version. However it's a bit painful
because it requires to rebuild pyeclib c code for you to see the actual
installed version.
This addition for liberasurecode_get_version enables caller to get the
version integer from compiled shared library file (.so) and it will
rescure to re-compiled operation from pyeclib.
Change-Id: I8161ea7da3b069e83c93e11cb41ce12fa60c6f32
Current isa-l has possibility to return corrupted decoded data or
corrupted reconstructed data on decode/reconstruct without error code.
That is from the specification of isa-l rs vandermond matrix discussed
at [1]. With many # of parities cases, we may hit the case above due to
failing to get the inverse matrix from the encode matrix.
The isa-l maintener gbtucker suggests a good way to detect the failing
inverse matrix, that we should handle the return value gf_invert_matrix.
If gf_invert_matrix returns not 0, we should stop to decode/reconstruct
and return failure return code to the caller immediately. Otherwise, the
caller regards the garbage data/fragment as correct one.
And this patch adds the specific test case we can hit the issue (it
happens not so general).
1: https://github.com/01org/isa-l/issues/10
Related-Change: I6eb150d9d0c3febf233570fa7729f9f72df2e9be
Change-Id: Icee788a0931fe692fe0de31fabc4ba450e338a87
Since the commit a01b1818c8,
we have been to able to test some parameters for each tests.
However, instead, the NULL which means the end of the test parameters
causes skipping a bunch of unit tests which doesn't take args (e.g.
test_create_backend_invalid_args). That is the worse because we have not
tested anymore for the tests since the commit.
This patch fixes to make it tested and more, fix a minor bug for a
case that corrupted header incomming to get_metadata.
Closes-Bug: #1634403
Change-Id: Ib99a8aa6032f02d0c7d1ab94b8da1ebfd9047d74
Users of liberasurecode <= 1.0.7 used alloc/free helpers
(which they shouldn't have). This change is to make sure
we are still able to those older revs of programs and they
work with newer liberasurecode.
https://bitbucket.org/tsg-/liberasurecode/issue/13/decode-fails-for-many-cases-when-m-k
This fix includes:
1.) Proper buffer allocation for the 'missing_idxs' structure, which was not allocating enough
space when k > m.
2.) Checks to use header fields of parity fragments during decode when *no* data fragments
are available.
3.) Fixed the unit tests to properly handle the case where k <= m.
4.) Extended the unit test framework to support multiple tests per backend
5.) Added tests for all RS implementations: (4,8), (4,4), (10,10)
Also added additional test to test_xor_code to do an exhaustive decode test
(all possible 1 and 2 disk failures) and changed teh default liberasurecode
test to test (3, 3, 3).
when both data and parity was missing. The fix is to just call decode
when reconstructing parity, since it will have to do extra work anyway
when data is missing. We did a little extra work in ISA-L to do better,
but can save that for later, since 99% of the time decode will perform just
fine.
On the current code, get_fragment_partition might touch the
invlid memory area with minus index (that means a invalid header)
and it causes segmentation fault.
This fixes it to handle the minus index as a EBADHEADER and then
no segmentaition fault appeared on the case.
Without these checks, backend libraries not being available
is causing errors like in tests that are missing these checks:
$ make test
[snip]
ok 1 - test_create_backend_invalid_args: UNKNOWN
lt-liberasurecode_test: liberasurecode_test.c:276: test_destroy_backend_invalid_args: Assertion `desc > 0' failed. make: *** [test] Aborted (core dumped)
Closes issue #6