473 Commits

Author SHA1 Message Date
Zuul
778bddf2c9 Merge "1.6.1 release" 1.6.1 2019-05-24 13:10:22 +00:00
Tim Burke
917859e239 1.6.1 release
Change-Id: Iaa6cc5bb06e715aafb3ecab86ae7cde6ef30413d
2019-05-23 16:03:58 -07:00
OpenDev Sysadmins
40dc74a6e9 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:51:24 +00:00
Tim Burke
7f7edb26bb Install yasm in RHEL based systems
...then switch CentOS job to be a voting gate job instead of
experimental.

Change-Id: I510e4da82deb779ece9ea5436b63c038a6c25b58
2019-04-09 10:09:16 -04:00
Zuul
8d7877fb19 Merge "Remove get_chksum to hush warnings" 2019-02-14 02:12:57 +00:00
Pete Zaitcev
7e97b2f808 Make our alt crc32 more portable
Apparently the author of our old crc32 assumed that shifting an int
to the right sign-extends, which is not always the case. Result is,
building and running make test on s390x fails. The fix is to force
a sign-extension using the "xor 0x80; sub 0x80" trick.

N.B. This does not cause a compatibility problem, because by a
miracle the "broken" crc32_alt was actually computing a stock
crc32, same that zlib has. Therefore, if someone, somewhere,
ran a Swift cluster on s390x with erasure coding policy,
the data in it is already stored with zlib checksums, as we
do it now anyway. This fix only permits the tests pass, which
used the bad data sample from x86.

Change-Id: Ibd5e4e6c02be00540a9648cc7e0f8efda275bf3f
Related-Change: Ib5ea2a830c7c23d66bf2ca404a3eb84ad00c5bc5
Related-Bug: 1666320
2019-02-13 21:25:33 +00:00
Pete Zaitcev
3564b711b4 Remove get_chksum to hush warnings
This popped up because Fedora mandates warning-free builds,
and get_chksum triggers a warning because it returns an
unaligned pointer (it is so analigned, static analysis in
the compiler can detect it).

The easiest fix is to remove it altogether. We think it should
be safe, because:

 - The function is not listed in any headers
 - Its counterpart is called "set_checksum", not "set_chksum"
 - PyECLib does not use it

We also hush some doxygen warnings about wrong comments.

Change-Id: Ie5bc736f912706e0ffd507765abd24e7f4761233
2019-02-13 00:46:52 -06:00
Zuul
405775cba1 Merge "Install Jerasure and ISA-L libs" 2018-10-22 19:10:33 +00:00
Thiago da Silva
096effe62a Install Jerasure and ISA-L libs
Install libraries to be tested w/ liberasurecode

Change-Id: Ic1cd7b61c780cf794640e4ce0d57e6126ad5756b
2018-10-22 10:40:16 -04:00
Ondřej Nový
b046ff7091 Fix building with LD_LIBRARY_PATH set
If LD_LIBRARY_PATH is set to any value, build will fail, example:
Making check in doc
...
/bin/bash: line 1: /usr/lib/libeatmydata: No such file or directory
...

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906480

Same is true for DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH.

This bug was introduced with commit 19442df2cd9a5bc8ec4deded7046ea7aca1d50a2
where Kota removed evals, but forgot to remove prepending of same env
variables.

Change-Id: Ib7a1d6b839d4a207ee0471b55233e1ce5d958705
2018-10-01 16:35:35 +02:00
Thiago da Silva
7df6c25191 Release 1.6.0
Change-Id: I97b85f1b37952aaede168e274d2f4a74d3b9aaa8
1.6.0
2018-09-21 10:28:15 -04:00
Tim Burke
7b547e0e46 Allow reading of little-endian frags on big-endian
... 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
2018-09-11 21:58:34 -06:00
Andreas Jaeger
72af842b28 Import Zuul unittests
Add the unittests in-tree and convert them as Zuul v3 native tests so
that they can be modified locally.

This adds a new job running on Ubuntu and an experimental CentOS-7 one.

Change-Id: Ib43e40280411623fda84f2068958b64a17cdc3dc
2018-03-01 20:02:26 +01:00
Tim Burke
7247b27d70 Print test that's going to run *before* running test
Should make it easier to diagnose failures.

Change-Id: I32ed3019c556706634aae91844bf57b0954af86a
2017-09-13 15:43:57 -06:00
Jenkins
d81c49161b Merge "flat_xor_hd: better validate args" 2017-09-13 21:33:43 +00:00
Jenkins
3ff4b22bc1 Merge "Negative data or parity args are invalid" 2017-09-13 21:24:27 +00:00
Tim Burke
082e4799d8 Negative data or parity args are invalid
While we're at it, tighten up some test_create_backend_invalid_args
assertions.

Change-Id: Id6c70cdb2d86580280ededc3ec6ec648c6cb7d57
2017-09-13 20:52:30 +00:00
Tim Burke
cf12c9ca26 flat_xor_hd: better validate args
Previously, we'd segfault with args like k=1, m=3, hd=3.

Change-Id: I8a1d92f388c54fe4f5b357eaf85a27e6b334df11
2017-09-13 20:46:19 +00:00
Jenkins
737843e14e Merge "Add dl to pkg-config metadata" 2017-09-13 20:23:43 +00:00
Jenkins
0dd6e1e41a Merge "Use preprocessor to build test suites" 2017-09-13 20:21:52 +00:00
Jenkins
dd1a91968f Merge "Use more backends in existing tests" 2017-09-13 20:21:46 +00:00
Jenkins
7ce7617c37 Merge "Make test format strings consistent with test function names" 2017-09-13 20:20:55 +00:00
Jenkins
504c09b3fe Merge "re-org of README" 2017-09-13 20:06:51 +00:00
Tim Burke
b5ad3290c2 Add dl to pkg-config metadata
This simplifies compiling by allowing users to include

   CFLAGS += `pkg-config --cflags erasurecode-1`
   LDFLAGS += `pkg-config --libs erasurecode-1`

in makefiles. Otherwise, trying to use pkg-config results in errors like

   /usr/local/lib/liberasurecode.so: undefined reference to `dlopen'
   /usr/local/lib/liberasurecode.so: undefined reference to `dlclose'
   /usr/local/lib/liberasurecode.so: undefined reference to `dlerror'
   /usr/local/lib/liberasurecode.so: undefined reference to `dlsym'
   collect2: error: ld returned 1 exit status

Change-Id: I39fb137b1a3b6b2beda1d0b28faef3132229ec3b
2017-07-13 13:26:00 -07:00
Tim Burke
f4a16fe929 Use preprocessor to build test suites
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
2017-07-13 13:24:01 -07:00
Tim Burke
6124e432a5 Use more backends in existing tests
This allows us to start defining test suites for common capabilities /
allowed failure modes.

Null Backend:
    test_decode_with_missing_parity
    test_decode_with_missing_multi_parity

Jerasure RS Vand:
    test_decode_with_missing_parity

Jerasure RS Cauchy:
    test_decode_with_missing_parity

ISA-L RS Vand:
    test_decode_with_missing_parity
    test_get_fragment_metadata_crc32

ISA-L RS Cauchy:
    test_decode_with_missing_parity
    test_get_fragment_metadata_crc32

SHSS:
    test_decode_with_missing_parity
    test_get_fragment_metadata_crc32

liberasurecode RS Vand:
    test_decode_with_missing_parity

Change-Id: I9ee9ec3d8f86a10c4c7b5d6425a530b9c44d1156
2017-07-13 13:22:07 -07:00
Tim Burke
34ff5208d4 Make test format strings consistent with test function names
* 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
2017-07-13 13:22:07 -07:00
Tim Burke
e426aee95b Un-inline get/set_metatdata_chksum
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
2017-07-06 18:02:02 +00:00
Tim Burke
a9b20ae6a3 Use zlib for CRC-32
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
2017-07-06 17:40:38 +00:00
Tim Burke
9b4d8bcf8d Stop pretending to support SSE4-optimized CRC-32C
It isn't the CRC we want, and we never used it anyway. While we may
define INTEL_SSE41 or INTEL_SSE42 if CPU seems to support it, we've
never defined INTEL_SSE4.

Change-Id: I04e1dd6458ccde58a0a2f3f4d6947569a31e9697
Partial-Bug: 1666320
2017-07-06 00:08:45 +00:00
Jenkins
24038b3588 Merge "Release 1.5.0" 1.5.0 2017-06-29 17:36:37 +00:00
Thiago da Silva
0f5bc4eaff re-org of README
Broke down the README a little bit to make it more readable.
Moved the API and dir organization to their own md files.

Change-Id: I7161daaa9515bd091e82a78dd8496ba23d5b7549
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2017-06-07 10:59:01 -04:00
Jenkins
dd31ac647b Merge "Stop using ceill() to compute padded data size" 2017-06-06 19:17:12 +00:00
Pete Zaitcev
960cdd09dc Stop using ceill() to compute padded data size
The well-known idiom to compute a required number of data blocks
of size B to contain data of length d is:

     (d + (B-1))/B

The code we use, with ceill(), computes the same value, but does
it in an unorthodox way. This makes a reviewer to doubt himself
and even run tests to make sure we're really computing the
obvious thing.

Apropos the reviewer confusion, the code in Phazr.IO looks weird.
It uses (word_size - hamming_distance) to compute the necessary
number of blocks... but then returns the amount of memory needed
to store blocks of a different size (word_size). We left all of it
alone and return exactly the same values that the old computation
returned.

All these computations were the only thing in the code that used
-lm, so drop that too.

Coincidentially, this patch solves the crash of distro-built
packages of liberasurecode (see Red Hat bug #1454543). But it's
a side effect. Expect a proper patch soon.

Change-Id: Ib297f6df304abf5ca8c27d3392b1107a525e0be0
2017-06-06 14:53:45 -04:00
Thiago da Silva
063885cc3c Release 1.5.0
Change-Id: I6903e11a24f548a07f924cef8f0bc8ba3c456ef0
2017-06-05 14:32:32 -04:00
Pete Zaitcev
0962144c51 Allow to disable optimizations for portability
We're having trouble on Fedora when the build system runs
on Intel CPUs. The ./configure detects AVX instructions and
builds liberasurecode with them. The resulting library crashes
with SIGILL when users run it on ADM CPUs without AVX.

See the details here:
 https://bugzilla.redhat.com/show_bug.cgi?id=1454543

The patch allows to disable the optimizations, so that
distro packaging then can invoke this options and build
portable libraries.

For the record, "make test" runs about 16% slower on an Intel
CPU if optimizations are disabled. So, there's a measurable
performance impact. However, operators intersted in outright
performance might want to consider Erasure Coding implementations
other than the one  built-in into liberasurecode. The library
supports other back-ends that are significantly faster than
even optimized built-in code.

Change-Id: I09603b97ceeb833ba582cf3217e0be51c019d645
2017-05-24 14:42:36 -06:00
Jenkins
de984f59e7 Merge "Stop running targeted tests repeatedly" 2017-05-10 20:37:55 +00:00
Jenkins
a17e50fd34 Merge "Stop running test_simple_encode_decode_over32 repeatedly" 2017-05-10 20:33:38 +00:00
Jenkins
0237240926 Merge "Fix warning on automake tool" 2017-05-10 15:35:41 +00:00
Jenkins
345f1a93a2 Merge "Jerasure: Handle initialization errors correctly" 2017-05-10 15:19:35 +00:00
Jenkins
7c4ef60c9d Merge "ISA-L: Only calculate gf tables on init, not every encode" 2017-03-29 06:49:41 +00:00
Tim Burke
842b4a9bd7 Jerasure: Handle initialization errors correctly
Otherwise we can get backtraces where we try to free something that was
never initialized.

Change-Id: Iaea427b977fd20819e2da5678cc4889d3a42dd65
2017-03-16 17:49:49 +00:00
Jenkins
26e4742140 Merge "Add Phazr.IO libphazr backend to liberasurecode" 2017-03-01 02:21:14 +00:00
Jim Cheung
06e50ea86b Add Phazr.IO libphazr backend to liberasurecode
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
2017-02-28 11:14:11 -08:00
Tim Burke
de6f3bec9c Stop running targeted tests repeatedly
Previously, we would run them four times, despite always using
the same backends and arguments.

Change-Id: Iede8e9e9689cbaf85c66adce72cb78983afb084b
2017-02-25 20:21:19 +00:00
Tim Burke
11244e449f Stop running test_simple_encode_decode_over32 repeatedly
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
2017-02-25 20:13:11 +00:00
Daniel Axtens
4ab1336cab jerasure: plug memory leaks
Jerasure inits some global variables on init.
We need to free them, or we'll leak memory.

Partial-Bug: #1666674

Change-Id: Ie7073738428a71910016e910a66dbd92ca98eb92
Signed-off-by: Daniel Axtens <dja@axtens.net>
2017-02-21 20:50:03 +00:00
Kota Tsuyuzaki
19442df2cd Fix warning on automake tool
This patch fixes automake tools warnings as follows (and a my fault
in previous patch [1]):

- Change INCLUDES variable to APP_CPP_FLAGS and APP_C_FLAGS according to
  the warning message

- Remove non-POSIX variable to suppress that warnings

Note that the latter change may be affected to the testing so please
be careful on your review what's going on your testing environment.
In the past change [2], they ware designed to use the shared
object binaries in the build path. However, Daniel had pointed out the good
thing at [1] if we runs the test/liberasruecode_test (it's shell with linker)
in the dir, we can touch the expected binaries.

My fault in the previous patch is that I didn't replace
./test/.libs/liberasurecode_test to ./test/liberasurecode_test even
we use --trace-children=yes option for the valgrind.

Now, all tests run via ./test/<test name> syntax and IMO no matters
exist even if we remove the non-POSIX variable for test settings.

1: https://review.openstack.org/#/c/434162
2: 93446db9414f311bd9fc7dc047eb4dbbeb3e6feb

Change-Id: I0e79bed7755a1f286b746a70fcf56fdc972bfd5d
2017-02-20 14:23:16 -08:00
Kota Tsuyuzaki
c9136a62b6 Fix valgrind-check and memory leak
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
2017-02-20 07:45:55 -08:00
Daniel Axtens
90679884ef ISA-L: Only calculate gf tables on init, not every encode
Currently, the Galois Field multiplication tables are recalcuated
every time an encode is done. This is wasteful, as they are fixed
by k and m, which is set on init.

Calculate the tables only once, on init.

This trades off a little bit of per-context memory and creation
time for measurably faster encodes when using the same context.

On powerpc64le, when repeatedly encoding a 4kB file with pyeclib,
this increases the measured speed by over 10%.

Change-Id: I2f025aaee2d13cb1717a331e443e179ad5a13302
Signed-off-by: Daniel Axtens <dja@axtens.net>
2017-02-13 09:43:24 +11:00