Commit 9a52ccc0 authored by Otto Kekäläinen's avatar Otto Kekäläinen

Imported Upstream version 25.3.15

parent b73ebad3
If you would like to contribute code to this repository, please <a href="https://www.clahub.com/agreements/codership/galera">sign the Contributor License Agreement</a>.
All contributors are required to add their name and [Github username/email]
to this file in connection with their first contribution. If you are making
a contribution on behalf of a company, you should add the said company name.
By adding your name and [Github username/email] to this file you agree that
your contribution is a contribution under a contributior agreement between
you and Codership Oy. To the extent that you are an employee of a company and
contribute in that role, you confirm that your contribution is a contribution
under the contribution license agreement between your employer and Codership
Oy; and that you have the authorization to give such confirmation. You confirm
that you have read, understood and signed the contributor license agreement
applicable to you.
For the individual contributor agreement see file CONTRIBUTOR_AGREEMENT.txt
in the same directory as this file.
Authors from Codership Oy:
* Alexey Yurchenko <alexey.yurchenko@galeracluster.com>, Codership Oy
* Seppo Jaakola <seppo.jaakola@galeracluster.com>, Codership Oy
* Teemu Ollakka <teemu.ollakka@galeracluster.com>, Codership Oy
* Daniele Sciascia <daniele.sciascia@galeracluster.com>, Codership Oy
* Philip Stoev <philip.stoev@galeracluster.com>, Codership Oy
[Codership employees, add name and email/username above this line, but leave this line intact]
Other contributors:
[add name and email/username above this line, but leave this line intact]
Codership Individual Contributor License Agreement
Thank you for your interest in contributing to Galera Cluster, a project
managed by Codership Oy, a legal entity established under Finnish laws, with
its principal address at Pohjolankatu 64 A, 00600 Helsinki Finland (“We”, “Us”
or “Our”).
This contributor agreement (“Agreement”) documents the rights granted by
contributors to Us. To make this document effective, please either accept it
in an electronic service such as clahub.com or sign and scan it and send it
to Us by email. This is a legally binding document, so please read it
carefully before agreeing to it. This Agreement covers the Galera Cluster
project: the Galera library, the Wsrep patch for MySQL and other eventual
patches to MySQL or other technologies.
(1) Definitions
“You” means the individual who Submits a Contribution to Us.
“Contribution” means any work of authorship that is Submitted by You to Us in
which You own or assert ownership of the Copyright. If You do not own the
Copyright in the entire work of authorship, you need to have a separate
permission from Us.
“Copyright” means all rights protecting works of authorship owned or
controlled by You, including copyright, moral and neighboring rights,
as appropriate, for the full term of their existence including any extensions
by You.
“Material” means the work of authorship which is made available by Us to third
parties, i.e. the Galera library, the Wsrep patch for MySQL; other eventual
patches to MySQL; other eventual patches to other database technologies; all
these together with a database technology, such as MySQL, or its derivatives.
After You Submit the Contribution, it may be included in the Material.
“Submit” means any form of electronic, verbal, or written communication sent
to Us or our representatives, including but not limited to electronic mailing
lists, source code control systems, and issue tracking systems that are
managed by, or on behalf of, Us for the purpose of discussing and improving
the Material, provided that such communication is (i) conspicuously marked or
otherwise designated in writing by You or Your employee as a “Contribution” or
(ii) submitted in source code control system pursuant to Section 3 (e).
“Submission Date” means the date on which You Submit a Contribution to Us.
“Effective Date” means the date You execute this Agreement or the date You
first Submit a Contribution to Us, whichever is earlier.
“Media” means any portion of a Contribution which is not software.
(2) Grant of Rights
2.1 Copyright License
(a) You retain ownership of the Copyright in Your Contribution and have the
same rights to use or license the Contribution which You would have had
without entering into the Agreement. In case we have in writing permitted
submitting a sublicense to licensed rights, You will not transfer the original
license, but grant us a sublicense in accordance with this Agreement.
(b) To the maximum extent permitted by the relevant law, You grant to Us
a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable
license under the Copyright covering the Contribution, with the right
to sublicense such rights through multiple tiers of sublicensees, to reproduce,
modify, display, perform and distribute the Contribution as part
of the Material; provided that this license is conditioned upon compliance
with Section 2.3.
2.2 Patent License
For patent claims including, without limitation, method, process, and
apparatus claims which You own, control or have the right to grant, now or
in the future, You grant to Us a perpetual, worldwide, non-exclusive,
transferable, royalty-free, irrevocable patent license, with the right
to sublicense these rights to multiple tiers of sublicensees, to make, have
made, use, sell, offer for sale, import and otherwise transfer
the Contribution and the Contribution in combination with the Material
(and portions of such combination). This license is granted only to the extent
that the exercise of the licensed rights infringes such patent claims;
and provided that this license is conditioned upon compliance with Section 2.3.
2.3 Outbound License
As a condition on the grant of rights in Sections 2.1 and 2.2, to the extent
we include Your Contribution or a part of it in a Material, we agree to
license the Contribution only under the terms of the license or licenses which
We are using on the Submission Date for the Material or any licenses which are
approved by the Open Source Initiative (“OSI”) on or after the Effective Date,
including both permissive and copyleft licenses, whether or not such licenses
are subsequently disapproved (including any right to adopt any future version
of a license if approved by the OSI). In addition to above defined licenses,
We may use the following licenses for Media in the Contribution: Creative
Commons BY 3.0 or Creative Commons BY-SA 3.0 (including the right to adopt any
future version of a license).
2.4 Moral Rights.
If moral rights apply to the Contribution, to the maximum extent permitted by
law, You waive and agree not to assert such moral rights against Us or our
successors in interest, or any of our licensees, either direct or indirect.
2.5 Enforcement.
You, as a copyright holder to Your Contribution, hereby authorize us
to enforce the OSI approved license applied by Us to a Material, but only
to the extent Your Contribution has been included in a Material and always
subject to Our free discretion on whether such enforcement is necessary or not.
2.6 Our Rights.
You acknowledge that We are not obligated to use Your Contribution as part of
the Material and may decide to include any Contribution We consider
appropriate.
2.7 Reservation of Rights.
Any rights not expressly licensed under this section are expressly reserved
by You.
(3) Agreement
You confirm that:
(a) You have the legal authority to enter into this Agreement.
(b) You own the Copyright and patent claims covering the Contribution which
are required to grant the rights under Section 2.
(c) The grant of rights under Section 2 does not violate any grant of rights
which You have made to third parties, including Your employer. If You are
an employee, You have had Your employer approve this Agreement or sign the
Entity version of this document. If You are less than eighteen years old,
please have Your parents or guardian sign the Agreement.
(d) You have not Submitted any Code You do not own without written permission
from US.
(e) All pull or merge requests issued under usernames confirmed by You
in writing are issued by You; and all such pull or merge requests contain
Your Contributions under this Agreement. You will notify Us in writing
in the event of You no longer control such usernames.
(4) Disclaimer
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED
“AS IS”. MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING,
WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
(5) Consequential Damage Waiver
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE
LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA,
INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING
OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT,
TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. THIS WAIVER DOES NOT APPLY
TO GROSS NEGLIGENT OR MALICIOUS ACTS OR FRAUD.
(6) Miscellaneous
6.1 This Agreement will be governed by and construed in accordance with the
laws of Finland excluding its conflicts of law provisions. Under certain
circumstances, the governing law in this section might be superseded by the
United Nations Convention on Contracts for the International Sale of Goods
(“UN Convention”) and the parties intend to avoid the application of the
UN Convention to this Agreement and, thus, exclude the application of the
UN Convention in its entirety to this Agreement.
6.2 Any and all Submissions done by You prior to execution of this Agreement
shall be nonetheless covered by this Agreement.
6.3 This Agreement sets out the entire agreement between You and Us for Your
Contributions to Us and overrides all other agreements or understandings.
6.4 If You or We assign the rights or obligations received through this
Agreement to a third party, as a condition of the assignment, that third party
must agree in writing to abide by all the rights and obligations in the
Agreement.
6.5 The failure of either party to require performance by the other party of
any provision of this Agreement in one situation shall not affect the right
of a party to require such performance at any time in the future. A waiver of
performance under a provision in one situation shall not be considered a
waiver of the performance of the provision in the future or a waiver of the
provision in its entirety.
6.6 If any provision of this Agreement is found void and unenforceable, such
provision will be replaced to the extent possible with a provision that comes
closest to the meaning of the original provision and which is enforceable.
The terms and conditions set forth in this Agreement shall apply
notwithstanding any failure of essential purpose of this Agreement or any
limited remedy to the maximum extent possible under law.
This document has been drafted based on Harmony Inividual Contributor License
Agreement (HA-CLA-I) Version 1.0 July 4, 2011. HA- CLA-I is available from
harmonyagreements.org and is licensed by under Creative Commons Attribution
3.0 Unported License.
......@@ -113,7 +113,7 @@ elif x86:
link_arch = ' -Wl,-melf_x86_64'
link_arch = compile_arch + link_arch
elif machine == 's390x':
compile_arch = ' -mzarch -march=z196 -mtune=zEC12'
compile_arch = ' -mzarch'
if bits == 32:
compile_arch += ' -m32'
......@@ -124,7 +124,7 @@ tests = int(ARGUMENTS.get('tests', 1))
strict_build_flags = int(ARGUMENTS.get('strict_build_flags', 1))
GALERA_VER = ARGUMENTS.get('version', '3.14')
GALERA_VER = ARGUMENTS.get('version', '3.15')
GALERA_REV = ARGUMENTS.get('revno', 'XXXX')
# Attempt to read from file if not given
......
// Copyright (C) 2010-2013 Codership Oy <info@codership.com>
// Copyright (C) 2010-2016 Codership Oy <info@codership.com>
// $Id$
......@@ -6,6 +6,7 @@
#include "../gcs_sm.hpp"
#include <check.h>
#include <math.h> // fabs
#include <string.h>
#include "gcs_sm_test.hpp"
......@@ -214,6 +215,8 @@ static void* pausing_thread (void* data)
return NULL;
}
static double const EPS = 1.0e-15; // double precision
START_TEST (gcs_sm_test_pause)
{
int q_len;
......@@ -236,9 +239,12 @@ START_TEST (gcs_sm_test_pause)
gcs_sm_stats_get (sm, &q_len, &q_len_max, &q_len_min, &q_len_avg,
&paused_ns, &paused_avg);
fail_if (paused_ns != 0.0);
fail_if (paused_avg != 0.0);
fail_if (q_len_avg != 0.0);
fail_if (paused_ns != 0,
"paused_ns: expected 0, got %lld", paused_ns);
fail_if (fabs(paused_avg) > EPS,
"paused_avg: expected <= %e, got %e", EPS, fabs(paused_avg));
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));
fail_if (q_len != 0);
fail_if (q_len_max != 0);
fail_if (q_len_min != 0);
......@@ -257,7 +263,8 @@ START_TEST (gcs_sm_test_pause)
&paused_ns, &paused_avg);
fail_if (paused_ns <= 0.0);
fail_if (paused_avg <= 0.0);
fail_if (q_len_avg != 0.0);
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));
gu_info ("Calling gcs_sm_continue()");
gcs_sm_continue (sm);
......@@ -275,7 +282,8 @@ START_TEST (gcs_sm_test_pause)
&tmp, &paused_avg);
fail_if (tmp <= paused_ns); paused_ns = tmp;
fail_if (paused_avg <= 0.0);
fail_if (q_len_avg != 0.0);
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));
gcs_sm_stats_flush(sm);
// Testing scheduling capability
......@@ -304,14 +312,16 @@ START_TEST (gcs_sm_test_pause)
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 (paused_avg != 0.0);
fail_if (fabs(paused_avg) > EPS,
"paused_avg: expected <= %e, got %e", EPS, fabs(paused_avg));
fail_if (q_len != sm->users, "found q_len %d, expected = %d",
q_len, sm->users);
fail_if (q_len_max != q_len, "found q_len_max %d, expected = %d",
q_len_max, q_len);
fail_if (q_len_min != 0, "found q_len_min %d, expected = 0",
q_len_min);
fail_if ((q_len_avg - 0.5) > 0.0000001 || (q_len_avg - 0.5) < -0.0000001);
fail_if (fabs(q_len_avg - 0.5) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));
gcs_sm_stats_flush(sm);
gu_info ("Started pause thread, users = %ld", sm->users);
......@@ -351,7 +361,8 @@ START_TEST (gcs_sm_test_pause)
&tmp, &paused_avg);
fail_if (tmp <= paused_ns); paused_ns = tmp;
fail_if (paused_avg <= 0.0);
fail_if (q_len_avg != 0.0);
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));
gcs_sm_enter (sm, &cond, false, true); // by now paused thread exited monitor
fail_if (sm->entered != 1, "entered = %ld, expected 1", sm->entered);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment