Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion include/mysql/service_wsrep.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum Wsrep_service_key_type
#else

/* Copyright (c) 2015, 2020, MariaDB Corporation Ab
2018 Codership Oy <[email protected]>
2018, 2025, Codership Oy <[email protected]>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -96,6 +96,7 @@ extern struct wsrep_service_st {
void (*wsrep_thd_kill_UNLOCK_func)(const MYSQL_THD thd);
void (*wsrep_thd_set_wsrep_PA_unsafe_func)(MYSQL_THD thd);
uint32 (*wsrep_get_domain_id_func)();
my_bool (*wsrep_applier_log_warnings)(const MYSQL_THD thd);
} *wsrep_service;

#define MYSQL_SERVICE_WSREP_INCLUDED
Expand Down Expand Up @@ -146,6 +147,7 @@ extern struct wsrep_service_st {
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
#define wsrep_get_domain_id(T) wsrep_service->wsrep_get_domain_id_func(T)
#define wsrep_applier_log_warnings(T) wsrep_service->wsrep_applier_log_warnings_func(T)
#else

#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
Expand Down Expand Up @@ -256,5 +258,6 @@ extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
/* declare parallel applying unsafety for the THD */
extern "C" void wsrep_thd_set_PA_unsafe(MYSQL_THD thd);
extern "C" uint32 wsrep_get_domain_id();
extern "C" my_bool wsrep_applier_log_warnings(const MYSQL_THD thd);
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
1 change: 1 addition & 0 deletions mysql-test/suite/galera/r/MW-369.result
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ SET SESSION DEBUG_SYNC = 'now SIGNAL signal.wsrep_apply_cb';
SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = 'RESET';
connection node_1;
call mtr.add_suppression("WSREP: Foreign key check table:.*");
connection node_2;
SELECT * FROM pg;
f1 f2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,4 @@ truncate user_session;
set debug_sync = reset;
connection node_1;
drop table user_session,user;
call mtr.add_suppression("WSREP: Foreign key check table:.*");
8 changes: 6 additions & 2 deletions mysql-test/suite/galera/r/galera_var_wsrep_mode.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ SET GLOBAL wsrep_mode='A';
ERROR 42000: Variable 'wsrep_mode' can't be set to the value of 'A'
SET GLOBAL wsrep_mode=NULL;
ERROR 42000: Variable 'wsrep_mode' can't be set to the value of 'NULL'
SET GLOBAL wsrep_mode=128;
ERROR 42000: Variable 'wsrep_mode' can't be set to the value of '128'
SET GLOBAL wsrep_mode=65536;
ERROR 42000: Variable 'wsrep_mode' can't be set to the value of '65536'
SET GLOBAL wsrep_mode=REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
SET GLOBAL wsrep_mode=1;
Expand Down Expand Up @@ -56,6 +56,10 @@ SET GLOBAL wsrep_mode=REPLICATE_ARIA;
SELECT @@wsrep_mode;
@@wsrep_mode
REPLICATE_ARIA
SET GLOBAL wsrep_mode=APPLIER_DISABLE_FK_WARNINGS;
SELECT @@wsrep_mode;
@@wsrep_mode
APPLIER_DISABLE_FK_WARNINGS
SET GLOBAL wsrep_mode=DISALLOW_LOCAL_GTID;
SELECT @@wsrep_mode;
@@wsrep_mode
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/galera/t/MW-369.test
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ INSERT INTO pg VALUES (2, 0);
# Commit succeeds
--connection node_1
--reap
call mtr.add_suppression("WSREP: Foreign key check table:.*");

--connection node_2
SELECT * FROM pg;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[no_warnigs]
wsrep-mode=APPLIER_DISABLE_FK_WARNINGS

[warnings]
wsrep-mode=0
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,5 @@ while($counter > 0)
--connection node_1

drop table user_session,user;

call mtr.add_suppression("WSREP: Foreign key check table:.*");
5 changes: 4 additions & 1 deletion mysql-test/suite/galera/t/galera_var_wsrep_mode.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SET GLOBAL wsrep_mode='A';
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode=128;
SET GLOBAL wsrep_mode=65536;
--error ER_PARSE_ERROR
SET GLOBAL wsrep_mode=REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM;
#
Expand All @@ -44,8 +44,11 @@ SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=REPLICATE_ARIA;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=APPLIER_DISABLE_FK_WARNINGS;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=DISALLOW_LOCAL_GTID;
SELECT @@wsrep_mode;

SET GLOBAL wsrep_mode='STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY';
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY,REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM,REPLICATE_ARIA,DISALLOW_LOCAL_GTID';
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/sys_vars/r/sysvars_wsrep.result
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ VARIABLE_COMMENT Set of WSREP features that are enabled.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY,REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM,REPLICATE_ARIA,DISALLOW_LOCAL_GTID,BF_ABORT_MARIABACKUP
ENUM_VALUE_LIST STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY,REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM,REPLICATE_ARIA,DISALLOW_LOCAL_GTID,BF_ABORT_MARIABACKUP,APPLIER_DISABLE_FK_WARNINGS
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
Expand Down
10 changes: 10 additions & 0 deletions sql/service_wsrep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,13 @@ extern "C" my_bool wsrep_thd_is_local_transaction(const THD *thd)
return (wsrep_thd_is_local(thd) &&
thd->wsrep_cs().transaction().active());
}

extern "C" my_bool wsrep_applier_log_warnings(const THD *thd)
{
/* Applier will log warning on fk errors if
(1) wsrep_mode != WSREP_MODE_APPLIER_DISABLE_WARNINGS AND
(2) thd executing is applier
*/
return (!wsrep_check_mode(WSREP_MODE_APPLIER_DISABLE_WARNINGS) &&
thd->wsrep_cs().mode() == wsrep::client_state::m_high_priority);
}
3 changes: 2 additions & 1 deletion sql/sql_plugin_services.inl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_thd_kill_LOCK,
wsrep_thd_kill_UNLOCK,
wsrep_thd_set_PA_unsafe,
wsrep_get_domain_id
wsrep_get_domain_id,
wsrep_applier_log_warnings
};

static struct thd_specifics_service_st thd_specifics_handler=
Expand Down
1 change: 1 addition & 0 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6111,6 +6111,7 @@ static const char *wsrep_mode_names[]=
"REPLICATE_ARIA",
"DISALLOW_LOCAL_GTID",
"BF_ABORT_MARIABACKUP",
"APPLIER_DISABLE_FK_WARNINGS",
NullS
};
static Sys_var_set Sys_wsrep_mode(
Expand Down
3 changes: 3 additions & 0 deletions sql/wsrep_dummy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,6 @@ void wsrep_thd_set_PA_unsafe(THD*)

uint32 wsrep_get_domain_id()
{ return 0;}

my_bool wsrep_applier_log_warnings(const THD*)
{ return 0;}
5 changes: 3 additions & 2 deletions sql/wsrep_mysqld.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2008-2023 Codership Oy <http://www.codership.com>
/* Copyright 2008-2025 Codership Oy <http://www.codership.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -131,7 +131,8 @@ enum enum_wsrep_mode {
WSREP_MODE_REPLICATE_MYISAM= (1ULL << 3),
WSREP_MODE_REPLICATE_ARIA= (1ULL << 4),
WSREP_MODE_DISALLOW_LOCAL_GTID= (1ULL << 5),
WSREP_MODE_BF_MARIABACKUP= (1ULL << 6)
WSREP_MODE_BF_MARIABACKUP= (1ULL << 6),
WSREP_MODE_APPLIER_DISABLE_WARNINGS= (1ULL << 7)
};

// Streaming Replication
Expand Down
Loading