-
Notifications
You must be signed in to change notification settings - Fork 149
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
PXC-4469: Implement CLONE method for SST #1996
base: 8.0
Are you sure you want to change the base?
Conversation
This version has a patch to go straight to ist so is not fully functional unless removing that bypass
SSL is NOT supported
bug. Wrong comma
fixing config missed wsrep allowed methods
fixing config missed wsrep allowed methods
fixing config missed wsrep allowed methods
…tcat is not running
Need to ad extension or make script will not identify them correctly
…the user Some edit/cleanup as suggested by Kamil
- removed the need to perform the restart to clean up the final instance. - use wsrep-sst-receive-address to get IP and port definition - use one port for Netcat and MySQL - some code cleanup - Add message suppression when reporting clone Status %. It will be reported only if different from previous value.
…e it. Some minor cleanup
…e it. Some minor cleanup
… node Add removing sst user at the end of the process commenting the CALL to bypass the warning on role tables.
Pxc 4469 sst clone
https://perconadev.atlassian.net/browse/PXC-4620 fixed: galera.galera_sst_clone - aligned with galera_sst_xtrabackup-v2 test Missing privileges granted / privileges cleanup: main.grant_dynamic_flush_upgrade main.roles-upgrade main.mysql_upgrade_slave_master_info main.plugin_auth main.mysql_57_inplace_upgrade main.mysql_80_inplace_upgrade main.component-upgrade main.grant_dynamic re-recorded: perfschema.privilege_table_io funcs_1.is_table_privileges funcs_1.is_schema_privileges main.transactional_acl_tables main.ps_sys_upgrade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/3)
struct sst_thread_arg { | ||
const char *cmd; | ||
char **env; | ||
const sst_auth& auth_container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
member variable auth_container
has public visibility
struct sst_thread_arg { | ||
const char *cmd; | ||
char **env; | ||
const sst_auth& auth_container; | ||
char *ret_str; | ||
int err; | ||
|
||
mysql_mutex_t LOCK_wsrep_sst_thread; | ||
mysql_cond_t COND_wsrep_sst_thread; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor does not initialize these fields: COND_wsrep_sst_thread
mysql_cond_t COND_wsrep_sst_thread; | |
mysql_cond_t COND_wsrep_sst_thread{}; |
char *ret_str; | ||
int err; | ||
|
||
mysql_mutex_t LOCK_wsrep_sst_thread; | ||
mysql_cond_t COND_wsrep_sst_thread; | ||
|
||
sst_thread_arg(const char *c, char **e) | ||
: cmd(c), env(e), ret_str(0), err(-1) { | ||
sst_thread_arg(const char *c, char **e, sst_auth& auth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter name c
is too short, expected at least 2 characters
char *ret_str; | ||
int err; | ||
|
||
mysql_mutex_t LOCK_wsrep_sst_thread; | ||
mysql_cond_t COND_wsrep_sst_thread; | ||
|
||
sst_thread_arg(const char *c, char **e) | ||
: cmd(c), env(e), ret_str(0), err(-1) { | ||
sst_thread_arg(const char *c, char **e, sst_auth& auth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter name e
is too short, expected at least 2 characters
sst_thread_arg(const char *c, char **e) | ||
: cmd(c), env(e), ret_str(0), err(-1) { | ||
sst_thread_arg(const char *c, char **e, sst_auth& auth) | ||
: cmd(c), env(e), auth_container(auth), ret_str(0), err(-1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use nullptr
: cmd(c), env(e), auth_container(auth), ret_str(0), err(-1) { | |
: cmd(c), env(e), auth_container(auth), ret_str(nullptr), err(-1) { |
@@ -700,8 +710,7 @@ | |||
static void reset_ld_preload(wsp::env &env) { env.append("LD_PRELOAD="); } | |||
#endif | |||
|
|||
static ssize_t sst_prepare_other(const char *method, const char *addr_in, | |||
const char **addr_out) { | |||
static ssize_t sst_prepare_other(const char *method, const char *addr_in, const char **addr_out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function sst_prepare_other
has cognitive complexity of 80 (threshold 50)
@@ -1254,6 +1266,7 @@ | |||
|
|||
static void *sst_donor_thread(void *a) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function sst_donor_thread
has cognitive complexity of 121 (threshold 50)
@@ -1318,6 +1331,21 @@ | |||
err = (ret < 0 ? ret : -EMSGSIZE); | |||
} | |||
|
|||
// if remote user is defined we will pass the user-name/password pair | |||
if (auth.remote_name_.length()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit conversion std::basic_string<char>::size_type
(aka unsigned long
) -> bool
if (auth.remote_name_.length()) | |
if (auth.remote_name_.length() != 0u) |
*/ | ||
const char* addr= strrchr(data, '@'); | ||
wsp::string remote_auth; | ||
if (addr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit conversion const char *
-> bool
if (addr) { | |
if (addr != nullptr) { |
|
||
/* Set up auth info (from <user>:<password> strings) */ | ||
sst_auth auth; | ||
if (remote_auth()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit conversion char *
-> bool
if (remote_auth()) { | |
if (remote_auth() != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (2/3)
@@ -0,0 +1,119 @@ | |||
--echo Performing State Transfer on a server that has been killed and restarted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected unqualified-id
|
||
--connection node_1 | ||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; | ||
SET AUTOCOMMIT=OFF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name SET
|
||
--connection node_1 | ||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; | ||
SET AUTOCOMMIT=OFF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use of undeclared identifier OFF
--connection node_1 | ||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; | ||
SET AUTOCOMMIT=OFF; | ||
START TRANSACTION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name START
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; | ||
SET AUTOCOMMIT=OFF; | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; | ||
SET AUTOCOMMIT=OFF; | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node1_committed_before'); | |
INSERT INTO; t1 VALUES ('node1_committed_before'); |
SET AUTOCOMMIT=OFF; | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
SET AUTOCOMMIT=OFF; | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node1_committed_before'); | |
INSERT INTO; t1 VALUES ('node1_committed_before'); |
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node1_committed_before'); | |
INSERT INTO; t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (3/3)
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node1_committed_before'); | |
INSERT INTO; t1 VALUES ('node1_committed_before'); |
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node1_committed_before'); | |
INSERT INTO; t1 VALUES ('node1_committed_before'); |
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
INSERT INTO t1 VALUES ('node1_committed_before'); | ||
|
||
--connection node_2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected unqualified-id
|
||
--connection node_2 | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node2_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
|
||
--connection node_2 | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node2_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node2_committed_before'); | |
INSERT INTO; t1 VALUES ('node2_committed_before'); |
--connection node_2 | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node2_committed_before'); | ||
INSERT INTO t1 VALUES ('node2_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown type name INSERT
--connection node_2 | ||
START TRANSACTION; | ||
INSERT INTO t1 VALUES ('node2_committed_before'); | ||
INSERT INTO t1 VALUES ('node2_committed_before'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected ;
after top level declarator
INSERT INTO t1 VALUES ('node2_committed_before'); | |
INSERT INTO; t1 VALUES ('node2_committed_before'); |
https://perconadev.atlassian.net/browse/PXC-4620 Addressed review comments. Cleanup granting privileges for mysql.pxc.internal.session.
https://perconadev.atlassian.net/browse/PXC-4620 We have to exclude pxc users during the upgrade to apply original rules for non-pxc users. This the extension of commit edcfa59 (PXC-3641).
PXC-4620: Fix MTR tests that fail after changes needed for clone SST
Pxc 4607 Fix bug PXC-4607 clone plugin is left installed on the joiner node
Fix for PXC-4609 clone sst user password is getting logged in the err…
Implement CLONE method for SST
Work in progress