Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Galera macos #23

Open
wants to merge 32 commits into
base: mariadb-4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dfe33f7
Merge branch 'galera-bugs#927' into galera-bugs#927-4.ee
ayurchen Jan 20, 2024
7047f7b
Merge branch 'galera-bugs#931-4.x' into galera-bugs#931-4.ee
ayurchen Feb 5, 2024
bdda0af
Merge branch '4.x-garbd-sigpipe' into 4.x-ee-garbd-sigpipe
janlindstrom Feb 23, 2024
997d13a
Merge branch 'ssl-comp-4.x' into ssl-comp-4.ee
ayurchen Feb 23, 2024
0beaf62
Merge branch 'last-applied-4.x' into last-applied-4.ee
ayurchen Mar 6, 2024
e76dae1
Merge remote-tracking branch 'origin/4.x-gcomm-connect' into 4.ee-gco…
temeo Mar 8, 2024
4788b95
Merge branch '4.x-asio-944' into 4.ee-asio-944
janlindstrom Mar 21, 2024
1e42980
Merge remote-tracking branch 'origin/4.x-26.4.18' into 4.ee-26.4.18
temeo Mar 22, 2024
72b51e7
Merge remote-tracking branch 'origin/4.x-ssl-cert-chain-gen' into 4.e…
temeo Apr 24, 2024
f91deec
Merge remote-tracking branch 'origin/phase-out-shared-4.x-cleanup' in…
temeo Apr 24, 2024
f6d296a
Merge remote-tracking branch 'origin/4.x-asio-server-hanshake-failure…
temeo May 3, 2024
37bd077
Merge remote-tracking branch 'origin/4.x-fix-rhel-7' into 4.ee-fix-rh…
temeo May 14, 2024
461beab
Merge branch '4.x-free-commit-cut' into 4.ee-free-commit-cut
temeo May 21, 2024
bcfbcae
Merge branch '4.x-wsrep-api-isolate' into 4.ee
temeo May 21, 2024
5fcc147
Merge branch 'joiner-vote-4.x' into joiner-vote-4.ee
ayurchen Jun 5, 2024
bc83fea
Merge branch 'auto-integers-4.x' into auto-integers-4.ee
ayurchen Jun 13, 2024
7e51b50
Merge remote-tracking branch 'origin/4.x-fix-wsrep-api-submodule' int…
temeo Jun 18, 2024
851c97c
Merge remote-tracking branch 'origin/4.x-26.4.19' into 4.ee-26.4.19
temeo Jun 24, 2024
8f98ded
jenkins pipelines
abychko Jul 5, 2024
a29ea67
pipeline concept to replace multijob logic
abychko Jun 29, 2024
2c8f34c
Merge branch 'jenkins-pipelines' into jenkins-pipelines-ee
abychko Jul 6, 2024
e89a0fb
Merge pull request #979 from codership/jenkins-pipelines
abychko Jul 7, 2024
63e1ddc
Add format conversion checks for C logging interface
temeo Jul 26, 2024
6a60ee4
Fix C logging format errors
temeo Jul 26, 2024
5261f6c
Merge branch '4.x-format-check' into 4.ee-format-check
temeo Jul 26, 2024
f12ff7e
Improve error and warning messages from Galera library
temeo Mar 30, 2024
db8cbde
Merge remote-tracking branch 'origin/4.x-error-messages' into 4.ee-er…
temeo Jul 29, 2024
fed8612
Bump Galera version to 26.4.20
temeo Jul 30, 2024
79a685e
Merge remote-tracking branch 'origin/4.x-26.4.20' into 4.ee-26.4.20
temeo Jul 30, 2024
e6f773b
- implement constructors/destructors for proper initialization of st…
ayurchen Aug 8, 2024
5dc30e6
Merge branch 'refactor-4.x' into refactor-4.ee
ayurchen Aug 12, 2024
78f68e9
Merge remote-tracking branch 'galera-bugs/4.ee' into galera-macos
janlindstrom Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .jenkins/aws-galera-4-ee-fullbuild.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@

pipeline {

agent none

stages {

stage ('Build sourcetar') {
steps {
script {

def sourceJob = build job: 'aws-galera-4-ee-sourcetar', wait: true,
parameters: [
string( name: 'GIT_TARGET', value: env.GIT_TARGET ),
booleanParam( name: 'HOTFIX_BUILD', value: env.HOTFIX_BUILD)
]
env.SRCTAR_JOB = sourceJob.getNumber().toString()
}
}
}

stage ('Build binary packages') {

parallel {
stage ('Build bintar') {
steps {
script {
def bintarJob = build job: 'aws-galera-4-ee-bintar', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.SRCTAR_JOB )]
env.BINTAR_JOB = bintarJob.getNumber().toString()
}
}
}
stage ('Build rpm packages') {
steps {
script {
def rpmJob = build job: 'aws-galera-4-ee-rpm-packages', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.SRCTAR_JOB )]
env.RPM_JOB = rpmJob.getNumber().toString()
}
}
}
stage ('Build deb packages') {
steps {
script {
def debJob = build job: 'aws-galera-4-ee-deb-packages', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.SRCTAR_JOB )]
env.DEB_JOB = debJob.getNumber().toString()
}
}
}
} // parallel

} // Build binary packages

stage ('Run tests') {
parallel {
stage('Run bintar test') {
steps {
build job: 'run-galera-4-ee-release-test', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.BINTAR_JOB )]
}
}
stage ('Run RPM test') {
steps {
build job: 'run-galera-4-ee-rpm-test', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.RPM_JOB )]
}
}
stage ('Run DEB test') {
steps {
build job: 'run-galera-4-ee-deb-test', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.DEB_JOB )]
}
}
stage ('Run SST RPM test') {
steps {
build job: 'run-galera-4-ee-systemd-sst-rpm-test', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.RPM_JOB )]
}
}
stage ('Run SST DEB test') {
steps {
build job: 'run-galera-4-ee-systemd-sst-deb-test', wait: true,
parameters: [string(name: 'BUILD_SELECTOR', value: env.DEB_JOB )]
}
}
} // parallel
}

} // stages

}
2 changes: 1 addition & 1 deletion GALERA_VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GALERA_VERSION_WSREP_API=26
GALERA_VERSION_MAJOR=4
GALERA_VERSION_MINOR=19
GALERA_VERSION_MINOR=20
GALERA_VERSION_EXTRA=
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static_ssl = ARGUMENTS.get('static_ssl', None)
install = ARGUMENTS.get('install', None)
version_script = int(ARGUMENTS.get('version_script', 1))

GALERA_VER = ARGUMENTS.get('version', '4.19')
GALERA_VER = ARGUMENTS.get('version', '4.20')
GALERA_REV = ARGUMENTS.get('revno', 'XXXX')

# Attempt to read from file if not given
Expand Down
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
galera-4 (26.4.19) UNRELEASED; urgency=medium
galera-4 (26.4.20) UNRELEASED; urgency=medium

* Galera 4 release

-- Codership Oy <[email protected]> Mon, 24 Jun 2024 20:10:30 +0300
-- Codership Oy <[email protected]> Tue, 30 Jul 2024 05:58:45 +0300
2 changes: 1 addition & 1 deletion galera/src/galera_gcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace galera
const char* node_name = 0,
const char* node_incoming = 0)
:
conn_(gcs_create(reinterpret_cast<gu_config_t*>(&config),
conn_(gcs_create(config,
reinterpret_cast<gcache_t*>(&cache),
cb,
node_name, node_incoming,
Expand Down
24 changes: 12 additions & 12 deletions galera/src/ist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ galera::ist::Receiver::prepare(wsrep_seqno_t const first_seqno,
return recv_addr_;
}


void galera::ist::Receiver::run()
{
auto socket(acceptor_->accept());
Expand All @@ -365,6 +364,7 @@ void galera::ist::Receiver::run()
gu::Progress<wsrep_seqno_t>* progress(NULL);

int ec(0);
std::ostringstream error_os;

try
{
Expand Down Expand Up @@ -410,9 +410,8 @@ void galera::ist::Receiver::run()
assert(!progress);
if (act.seqno_g > first_seqno_)
{
log_error
<< "IST started with wrong seqno: " << act.seqno_g
<< ", expected <= " << first_seqno_;
error_os << "IST started with wrong seqno: " << act.seqno_g
<< ", expected <= " << first_seqno_;
ec = EINVAL;
goto err;
}
Expand All @@ -438,8 +437,8 @@ void galera::ist::Receiver::run()

if (act.seqno_g != current_seqno_)
{
log_error << "Unexpected action seqno: " << act.seqno_g
<< " expected: " << current_seqno_;
error_os << "Unexpected action seqno: " << act.seqno_g
<< " expected: " << current_seqno_;
ec = EINVAL;
goto err;
}
Expand Down Expand Up @@ -508,7 +507,7 @@ void galera::ist::Receiver::run()
ec = e.get_errno();
if (ec != EINTR)
{
log_error << "got exception while reading IST stream: " << e.what();
error_os << "got exception while reading IST stream: " << e.what();
}
}

Expand All @@ -518,17 +517,18 @@ void galera::ist::Receiver::run()
socket->close();

running_ = false;
if (last_seqno_ > 0 && ec != EINTR && current_seqno_ < last_seqno_)
if (last_seqno_ > 0 && ec != EINTR && current_seqno_ < last_seqno_ &&
error_os.tellp() == 0)
{
log_error << "IST didn't contain all write sets, expected last: "
<< last_seqno_ << " last received: " << current_seqno_;
error_os << "IST didn't contain all write sets, expected last: "
<< last_seqno_ << " last received: " << current_seqno_;
ec = EPROTO;
}
if (ec != EINTR)
{
error_code_ = ec;
}
handler_.ist_end(ec);
handler_.ist_end(Result{ec, error_os.str()});
}


Expand Down Expand Up @@ -803,7 +803,7 @@ void galera::ist::AsyncSenderMap::run(const gu::Config& conf,
if (err != 0)
{
delete as;
gu_throw_error(err) << "failed to start sender thread";
gu_throw_system_error(err) << "failed to start sender thread";
}
senders_.insert(as);
}
Expand Down
11 changes: 10 additions & 1 deletion galera/src/ist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ namespace galera
void register_params(gu::Config& conf);


struct Result
{
int error;
std::string error_str;
Result(int error_arg, const std::string& error_str_arg)
: error{error_arg}
, error_str{error_str_arg}
{ }
};
// IST event handler interface
class EventHandler
{
Expand All @@ -40,7 +49,7 @@ namespace galera
virtual void ist_cc(const gcs_act_cchange&,const gcs_action&,
bool must_apply, bool preload) = 0;
// Report IST end
virtual void ist_end(int error) = 0;
virtual void ist_end(const Result&) = 0;
protected:
virtual ~EventHandler() {}
};
Expand Down
3 changes: 2 additions & 1 deletion galera/src/ist_proto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ namespace galera
}
else
{
gu_throw_error(-msg.ctrl()) <<"peer reported error";
gu_throw_error(-msg.ctrl())
<< "peer reported error: " << -msg.ctrl();
}
}
default:
Expand Down
17 changes: 10 additions & 7 deletions galera/src/mapped_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,23 @@ void galera::MappedBuffer::reserve(size_t sz)
fd_ = mkstemp(&file_[0]);
if (fd_ == -1)
{
gu_throw_error(errno) << "mkstemp(" << file_ << ") failed";
gu_throw_system_error(errno)
<< "mkstemp(" << file_ << ") failed";
}
if (ftruncate(fd_, sz) == -1)
{
gu_throw_error(errno) << "ftruncate() failed";
gu_throw_system_error(errno) << "ftruncate() failed";
}
byte_t* tmp(reinterpret_cast<byte_t*>(
mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
fd_, 0)));
if (tmp == MAP_FAILED)
{
const int error = errno;
free(buf_);
buf_ = 0;
clear();
gu_throw_error(ENOMEM) << "mmap() failed";
gu_throw_system_error(error) << "mmap() failed";
}
copy(buf_, buf_ + buf_size_, tmp);
free(buf_);
Expand All @@ -109,19 +111,20 @@ void galera::MappedBuffer::reserve(size_t sz)
{
if (munmap(buf_, real_buf_size_) != 0)
{
gu_throw_error(errno) << "munmap() failed";
gu_throw_system_error(errno) << "munmap() failed";
}
if (ftruncate(fd_, sz) == -1)
{
gu_throw_error(errno) << "fruncate() failed";
gu_throw_system_error(errno) << "fruncate() failed";
}
byte_t* tmp(reinterpret_cast<byte_t*>(
mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd_, 0)));
if (tmp == MAP_FAILED)
{
const int error = errno;
buf_ = 0;
clear();
gu_throw_error(ENOMEM) << "mmap() failed";
gu_throw_system_error(error) << "mmap() failed";
}
buf_ = tmp;
}
Expand All @@ -132,7 +135,7 @@ void galera::MappedBuffer::reserve(size_t sz)
byte_t* tmp(reinterpret_cast<byte_t*>(realloc(buf_, sz)));
if (tmp == 0)
{
gu_throw_error(ENOMEM) << "realloc failed";
gu_throw_system_error(ENOMEM) << "realloc failed";
}
buf_ = tmp;
}
Expand Down
24 changes: 13 additions & 11 deletions galera/src/replicator_smm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "galera_common.hpp"
#include "replicator_smm.hpp"
#include "gcs_action_source.hpp"
#include "gcs_error.hpp"
#include "galera_exception.hpp"

#include "galera_info.hpp"
Expand Down Expand Up @@ -315,7 +316,6 @@ galera::ReplicatorSMM::~ReplicatorSMM()
delete as_;
}


wsrep_status_t galera::ReplicatorSMM::connect(const std::string& cluster_name,
const std::string& cluster_url,
const std::string& state_donor,
Expand Down Expand Up @@ -348,14 +348,14 @@ wsrep_status_t galera::ReplicatorSMM::connect(const std::string& cluster_name,

if (ret == WSREP_OK && (err = gcs_.set_initial_position(inpos)) != 0)
{
log_error << "gcs init failed:" << strerror(-err);
log_error << "gcs init failed:" << gcs_error_str(-err);
ret = WSREP_NODE_FAIL;
}

if (ret == WSREP_OK &&
(err = gcs_.connect(cluster_name, cluster_url, bootstrap)) != 0)
{
log_error << "gcs connect failed: " << strerror(-err);
log_error << "gcs connect failed: " << gcs_error_str(-err);
ret = WSREP_NODE_FAIL;
}

Expand Down Expand Up @@ -1590,8 +1590,8 @@ wsrep_status_t galera::ReplicatorSMM::sync_wait(wsrep_gtid_t* upto,
}
catch (gu::Exception& e)
{
log_warn << "gcs_caused() returned " << -e.get_errno()
<< " (" << strerror(e.get_errno()) << ")";
log_debug << "gcs_caused() returned " << -e.get_errno()
<< " (" << strerror(e.get_errno()) << ")";
return WSREP_TRX_FAIL;
}
}
Expand Down Expand Up @@ -1689,7 +1689,7 @@ wsrep_status_t galera::ReplicatorSMM::wait_nbo_end(TrxHandleMaster* trx,
else if (err < 0)
{
log_error << "Failed to send NBO-end: " << err << ": "
<< ::strerror(-err);
<< gcs_error_str(-err);
return WSREP_NODE_FAIL;
}

Expand Down Expand Up @@ -1960,7 +1960,8 @@ galera::ReplicatorSMM::preordered_commit(wsrep_po_handle_t& handle,

if (rcode < 0)
gu_throw_error(-rcode)
<< "Replication of preordered writeset failed.";
<< "Replication of preordered writeset failed: "
<< gcs_error_str(-rcode);
}

delete ws; // cleanup regardless of commit flag
Expand Down Expand Up @@ -2281,7 +2282,7 @@ void galera::ReplicatorSMM::process_vote(wsrep_seqno_t const seqno_g,
default: /* general error */
assert(ret < 0);
msg << "Failed to vote on request for " << gtid << ": "
<< -ret << " (" << ::strerror(-ret) << "). "
<< -ret << " (" << gcs_error_str(-ret) << "). "
"Assuming inconsistency";
goto fail;
}
Expand Down Expand Up @@ -3075,8 +3076,9 @@ void galera::ReplicatorSMM::process_join(wsrep_seqno_t seqno_j,
if (seqno_j < 0 && S_JOINING == state_())
{
// #595, @todo: find a way to re-request state transfer
log_fatal << "Failed to receive state transfer: " << seqno_j
<< " (" << strerror (-seqno_j) << "), need to restart.";
log_fatal << "Failed to receive state transfer: " << seqno_j << " ("
<< gcs_state_transfer_error_str(-seqno_j)
<< "), need to restart.";
abort();
}
else
Expand Down Expand Up @@ -3191,7 +3193,7 @@ void galera::ReplicatorSMM::desync()

if (ret)
{
gu_throw_error (-ret) << "Node desync failed.";
gu_throw_error(-ret) << gcs_error_str(-ret);
}
}

Expand Down
Loading