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

Trunk missing merges #2044

Merged
merged 12 commits into from
Feb 26, 2025

Conversation

kamil-holubicki
Copy link
Contributor

No description provided.

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
…-4173

PXC-4173: PXC node stalls with parallel replication workers executing…

Cherry picked commits ffc98b4, 63d2342, e783b43
Copy link

@github-actions github-actions bot left a 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) {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-explicit-constructor ⚠️
single-argument constructors must be marked explicit to avoid unintentional implicit conversions

Suggested change
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-container-contains ⚠️
use contains to check for membership

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-container-contains ⚠️
use contains to check for membership

Suggested change
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-container-contains ⚠️
use contains to check for membership

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-container-contains ⚠️
use contains to check for membership

Suggested change
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 &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Table_ref * -> bool

Suggested change
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 &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion sp_rcontext * -> bool

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-use-nullptr ⚠️
use nullptr

Suggested change
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr),

Copy link

@github-actions github-actions bot left a 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),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-cstyle-cast ⚠️
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),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-cstyle-cast ⚠️
do not use C-style cast to convert between unrelated types


static Sys_var_bool Sys_wsrep_async_monitor(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-interfaces-global-init ⚠️
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),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-cstyle-cast ⚠️
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-static-cast-downcast ⚠️
do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead

Suggested change
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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-const-cast ⚠️
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-macro-usage ⚠️
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) &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion int -> bool

Suggested change
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) &&

Copy link

@github-actions github-actions bot left a 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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-pro-type-cstyle-cast ⚠️
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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-readability-casting ⚠️
C-style casts are discouraged; use reinterpret_cast

Suggested change
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));

Comment on lines +539 to +540
} else {
#ifdef UNIV_DEBUG

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ llvm-else-after-return ⚠️
do not use else after return

Suggested change
} else {
#ifdef UNIV_DEBUG
} #ifdef UNIV_DEBUG

} else {
#ifdef UNIV_DEBUG
wsrep_xid_sanity_check(xid);
#endif /* UNIV_DEBUG */
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ llvm-else-after-return ⚠️
do not use else after return

Suggested change
}

/* 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)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion int -> bool

Suggested change
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)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-use-nullptr ⚠️
use nullptr

Suggested change
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)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-use-nullptr ⚠️
use nullptr

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Table_ref * -> bool

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
if (wsrep_async_monitor) {
if (wsrep_async_monitor != nullptr) {

Copy link

@github-actions github-actions bot left a 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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-implicit-bool-conversion ⚠️
implicit conversion Wsrep_async_monitor * -> bool

Suggested change
if (wsrep_async_monitor) {
if (wsrep_async_monitor != nullptr) {

@kamil-holubicki kamil-holubicki merged commit e585219 into percona:trunk Feb 26, 2025
2 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants