Source: galera-3
Version: 25.3.23-1
Severity: important
Tags: ftbfs, patch
User: debian-h...@lists.debian.org
Usertags: hurd-i386
Hello,
Currently galera-3 FTBFS on GNU/Hurd due to that some functions are not
yet available: posix_fadvise, msync and pthread_setschedparam.
Attached are three patches to fix this:
galerautils_src_gu_mmap.cpp.diff
galerautils_src_gu_thread.cpp.diff
gcache_src_gcache_page.cpp.diff
Additionally one test fails due to a too short timeout:
galera_tests_saved_state_check.cpp.diff
and finally a comparison in a test corrected:
gcs_src_unit_tests_gcs_sm_test.cpp.diff
The reasoning behind that patch is:
Original source: fail_if (tmp <= paused_ns); paused_ns = tmp;
If tmp equals paused_ns the test fails, so why set paused_ns = tmp?
Therefore the equals sign should be removed:
fail_if (tmp < paused_ns); paused_ns = tmp;
as the patch does.
Together with the patch galerautils_src_gu_resolver.cpp.diff for
Hurd+kfreeBSD #906081 galera-3 builds fine.
Thanks!
--- a/galerautils/src/gu_mmap.cpp 2018-02-06 11:47:00.000000000 +0100
+++ b/galerautils/src/gu_mmap.cpp 2018-08-13 17:09:02.000000000 +0200
@@ -90,12 +90,13 @@
(uint64_t(addr) & PAGE_SIZE_MASK));
size_t const sync_length
(length + (static_cast<uint8_t*>(addr) - sync_addr));
-
+#if !defined(__GNU__)
if (::msync(sync_addr, sync_length, MS_SYNC) < 0)
{
gu_throw_error(errno) << "msync(" << sync_addr << ", "
<< sync_length << ") failed";
}
+#endif
}
void
--- a/galerautils/src/gu_thread.cpp 2018-02-06 11:47:00.000000000 +0100
+++ b/galerautils/src/gu_thread.cpp 2018-08-13 17:13:16.000000000 +0200
@@ -85,9 +85,11 @@
#else
struct sched_param spstr = { sp.prio() };
#endif
- int err;
+ int err = 0;
+#if !defined(__GNU__)
if ((err = pthread_setschedparam(thd, sp.policy(), &spstr)) != 0)
{
gu_throw_error(err) << "Failed to set thread schedparams " << sp;
}
+#endif
}
--- a/gcache/src/gcache_page.cpp 2018-02-06 11:47:00.000000000 +0100
+++ b/gcache/src/gcache_page.cpp 2018-08-13 12:52:03.000000000 +0200
@@ -35,7 +35,7 @@
{
mmap_.dont_need();
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(__GNU__)
int const err (posix_fadvise (fd_.get(), 0, fd_.size(),
POSIX_FADV_DONTNEED));
if (err != 0)
Index: galera-3-25.3.23/galera/tests/saved_state_check.cpp
===================================================================
--- galera-3-25.3.23.orig/galera/tests/saved_state_check.cpp
+++ galera-3-25.3.23/galera/tests/saved_state_check.cpp
@@ -225,7 +225,7 @@ Suite* saved_state_suite()
tcase_add_test (tc, test_basic);
tcase_add_test (tc, test_unsafe);
tcase_add_test (tc, test_corrupt);
- tcase_set_timeout(tc, 120);
+ tcase_set_timeout(tc, 240);
suite_add_tcase (s, tc);
return s;
--- a/gcs/src/unit_tests/gcs_sm_test.cpp 2018-02-06 11:47:00.000000000 +0100
+++ b/gsc/src/unit_tests/gcs_sm_test.cpp 2018-08-14 00:41:20.000000000 +0200
@@ -280,7 +280,7 @@ START_TEST (gcs_sm_test_pause)
long long tmp;
gcs_sm_stats_get (sm, &q_len, &q_len_max, &q_len_min, &q_len_avg,
&tmp, &paused_avg);
- fail_if (tmp <= paused_ns); paused_ns = tmp;
+ fail_if (tmp < paused_ns); paused_ns = tmp;
fail_if (paused_avg <= 0.0);
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));