-
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
Trunk missing merges #2044
Trunk missing merges #2044
Conversation
PXC-4544: Wrong Error message for 'RESET BINARY LOGS AND GTIDS' on cluster node. Cherry pick commit 7d7cce8
(8.4) PXC-4576: Remove extra_port handling in wsrep_sst_xtrabackup-v2 SST script Cherry pick commit 63b951f
(8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnf Cherry pick commit a6afd29
Null merge 8.0 -> 8.4 # Conflicts: # mysql-test/include/mtr_check.sql Cherry pick commit 2775965
(8.4) PXC-4393: Error lost in wsrep_sst_xtrabackup_v2 Cherry pick commit 2b45465
…cker-8.4 Clang format checker 8.4 Cherry pick commit f5b2788
(8.4) PXC-4504: DROP PROCEDURE/FUNCTION IF EXISTS generates local GTID event Cherry pick commit 494ccbf
(8.4) clang-tidy check fixed Cherry pick commit 897dbf2
(8.4) PXC-4498: PXC node "stalls" and causes the cluster to stop responding Cherry pick commit b5c52da
(8.4) PXC-4573: SST Role lacks INNODB_REDO_LOG_ARCHIVE Cherry pick commit 697b169
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/4)
|
||
class Wsrep_async_monitor { | ||
public: | ||
Wsrep_async_monitor(unsigned long count) : m_workers_count(count) {} |
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.
single-argument constructors must be marked explicit to avoid unintentional implicit conversions
Wsrep_async_monitor(unsigned long count) : m_workers_count(count) {} | |
explicit Wsrep_async_monitor(unsigned long count) : m_workers_count(count) {} |
std::unique_lock<std::mutex> lock(m_mutex); | ||
|
||
// Don't wait if it is a skipped seqno | ||
if (skipped_seqnos.count(seqno) > 0) return; |
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 contains
to check for membership
if (skipped_seqnos.count(seqno) > 0) return; | |
if (skipped_seqnos.contains(seqno)) return; |
// To proceed, it needs to remove all the skipped seqnos from the | ||
// scheduled_seqnos queue. | ||
while (!scheduled_seqnos.empty() && | ||
skipped_seqnos.count(scheduled_seqnos.front()) > 0) { |
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 contains
to check for membership
skipped_seqnos.count(scheduled_seqnos.front()) > 0) { | |
skipped_seqnos.contains(scheduled_seqnos.front())) { |
std::unique_lock<std::mutex> lock(m_mutex); | ||
|
||
// Don't wait if it is a skipped seqno | ||
if (skipped_seqnos.count(seqno) > 0) return; |
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 contains
to check for membership
if (skipped_seqnos.count(seqno) > 0) return; | |
if (skipped_seqnos.contains(seqno)) return; |
std::unique_lock<std::mutex> lock(m_mutex); | ||
|
||
// Check if the seqno is already marked as skipped | ||
if (skipped_seqnos.count(seqno) > 0) { |
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 contains
to check for membership
if (skipped_seqnos.count(seqno) > 0) { | |
if (skipped_seqnos.contains(seqno)) { |
|
||
if (!rpl_filter->is_on()) return false; | ||
|
||
bool ret = tables && !thd->sp_runtime_ctx && |
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 Table_ref *
-> bool
bool ret = tables && !thd->sp_runtime_ctx && | |
bool ret = (tables != nullptr) && !thd->sp_runtime_ctx && |
|
||
if (!rpl_filter->is_on()) return false; | ||
|
||
bool ret = tables && !thd->sp_runtime_ctx && |
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 sp_rcontext *
-> bool
bool ret = tables && !thd->sp_runtime_ctx && | |
bool ret = tables && (thd->sp_runtime_ctx == nullptr) && |
!thd->wsrep_applier) { | ||
Slave_worker *sw = dynamic_cast<Slave_worker *>(thd->rli_slave); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
!thd->wsrep_applier && !db_ok) { | ||
Slave_worker *sw = dynamic_cast<Slave_worker *>(thd->rli_slave); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(wsrep_trx_fragment_unit_update)); | ||
HINT_UPDATEABLE SESSION_VAR(wsrep_trx_fragment_unit), | ||
CMD_LINE(REQUIRED_ARG), wsrep_fragment_units, DEFAULT(WSREP_FRAG_BYTES), | ||
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), |
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
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), | |
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(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/4)
"wsrep_provider_options should be used in production.", | ||
READ_ONLY GLOBAL_VAR(wsrep_gcache_encrypt), CMD_LINE(OPT_ARG), wsrep_encrypt_modes, | ||
DEFAULT(WSREP_ENCRYPT_MODE_NONE), NO_MUTEX_GUARD, NOT_IN_BINLOG); | ||
READ_ONLY GLOBAL_VAR(wsrep_gcache_encrypt), CMD_LINE(OPT_ARG), |
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.
do not use C-style cast to convert between unrelated types
"wsrep_provider_options should be used in production.", | ||
READ_ONLY GLOBAL_VAR(wsrep_disk_pages_encrypt), CMD_LINE(OPT_ARG), wsrep_encrypt_modes, | ||
DEFAULT(WSREP_ENCRYPT_MODE_NONE), NO_MUTEX_GUARD, NOT_IN_BINLOG); | ||
READ_ONLY GLOBAL_VAR(wsrep_disk_pages_encrypt), CMD_LINE(OPT_ARG), |
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.
do not use C-style cast to convert between unrelated types
|
||
static Sys_var_bool Sys_wsrep_async_monitor( |
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.
initializing non-local variable with non-const expression depending on uninitialized non-local variable wsrep_use_async_monitor
"'wsrep_use_async_monitor' to avoid " | ||
"such deadlocks." | ||
"This variable is only allowed to be changed through command line.", | ||
READ_ONLY GLOBAL_VAR(wsrep_use_async_monitor), CMD_LINE(OPT_ARG), |
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.
do not use C-style cast to convert between unrelated types
#ifdef WITH_WSREP | ||
Wsrep_async_monitor *wsrep_async_monitor{ | ||
rli->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
rli->info_thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER && | ||
!thd_is_wsrep_applier && res == FILTERED_OUT) { | ||
Slave_worker *sw = | ||
static_cast<Slave_worker *>(const_cast<Relay_log_info *>(rli)); |
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.
do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead
static_cast<Slave_worker *>(const_cast<Relay_log_info *>(rli)); | |
dynamic_cast<Slave_worker *>(const_cast<Relay_log_info *>(rli)); |
rli->info_thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER && | ||
!thd_is_wsrep_applier && res == FILTERED_OUT) { | ||
Slave_worker *sw = | ||
static_cast<Slave_worker *>(const_cast<Relay_log_info *>(rli)); |
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.
do not use const_cast
Slave_worker *sw = | ||
static_cast<Slave_worker *>(const_cast<Relay_log_info *>(rli)); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
@@ -387,19 +389,141 @@ page_no_t trx_sysf_rseg_find_page_no(ulint rseg_id) { | |||
|
|||
#ifdef WITH_WSREP | |||
|
|||
#define WSREP_UUID_SIZE 16 |
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.
macro WSREP_UUID_SIZE
used to declare a constant; consider using a constexpr
constant
unsigned char xid_uuid[WSREP_UUID_SIZE]; | ||
long long xid_seqno = read_wsrep_xid_seqno(xid); | ||
read_wsrep_xid_uuid(xid, xid_uuid); | ||
if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, WSREP_UUID_SIZE) && |
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 int
-> bool
if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, WSREP_UUID_SIZE) && | |
if ((memcmp(xid_uuid, trx_sys_cur_xid_uuid, WSREP_UUID_SIZE) == 0) && |
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/4)
char uuid_str[40] = { | ||
0, | ||
}; | ||
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str, sizeof(uuid_str)); |
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.
do not use C-style cast to convert between unrelated types
char uuid_str[40] = { | ||
0, | ||
}; | ||
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str, sizeof(uuid_str)); |
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.
C-style casts are discouraged; use reinterpret_cast
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str, sizeof(uuid_str)); | |
wsrep_uuid_print(reinterpret_cast<const wsrep_uuid_t *>(xid_uuid), uuid_str, sizeof(uuid_str)); |
} else { | ||
#ifdef UNIV_DEBUG |
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.
do not use else
after return
} else { | |
#ifdef UNIV_DEBUG | |
} #ifdef UNIV_DEBUG |
} else { | ||
#ifdef UNIV_DEBUG | ||
wsrep_xid_sanity_check(xid); | ||
#endif /* UNIV_DEBUG */ | ||
} |
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.
do not use else
after return
} | |
/* If 'IF EXISTS' clause is present, we replicate always. | ||
In such a case binlogging part is done on the caller level. */ | ||
if (WSREP(thd) && | ||
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { |
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 int
-> bool
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { | |
(wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL) != 0)) { |
/* If 'IF EXISTS' clause is present, we replicate always. | ||
In such a case binlogging part is done on the caller level. */ | ||
if (WSREP(thd) && | ||
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { |
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
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { | |
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, nullptr, NULL)) { |
/* If 'IF EXISTS' clause is present, we replicate always. | ||
In such a case binlogging part is done on the caller level. */ | ||
if (WSREP(thd) && | ||
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { |
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
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, NULL)) { | |
wsrep_to_isolation_begin(thd, WSREP_MYSQL_DB, NULL, nullptr)) { |
@@ -2243,8 +2252,7 @@ static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table, | |||
If any of the remaining tables refer to temporary table error | |||
is returned to client, so TOI can be skipped | |||
*/ | |||
for (Table_ref *it = first_table->next_global; it; | |||
it = it->next_global) { | |||
for (Table_ref *it = first_table->next_global; it; it = it->next_global) { |
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 Table_ref *
-> bool
for (Table_ref *it = first_table->next_global; it; it = it->next_global) { | |
for (Table_ref *it = first_table->next_global; it != nullptr; it = it->next_global) { |
} | ||
Slave_worker *sw = dynamic_cast<Slave_worker *>(thd->rli_slave); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
if (thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) { | ||
Slave_worker *sw = dynamic_cast<Slave_worker *>(thd->rli_slave); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != 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 (4/4)
@@ -7692,6 +7709,13 @@ wsrep_restart_point : | |||
delete commit_order_mngr; | |||
} | |||
|
|||
#ifdef WITH_WSREP | |||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
if (thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) { | ||
Slave_worker *sw = dynamic_cast<Slave_worker *>(thd->rli_slave); | ||
Wsrep_async_monitor *wsrep_async_monitor{sw->get_wsrep_async_monitor()}; | ||
if (wsrep_async_monitor) { |
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 Wsrep_async_monitor *
-> bool
if (wsrep_async_monitor) { | |
if (wsrep_async_monitor != nullptr) { |
No description provided.