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

(8.0) PXC-4498: PXC node "stalls" and causes the cluster to stop responding #2021

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

kamil-holubicki
Copy link
Contributor

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/1)

@@ -387,19 +389,142 @@ page_no_t trx_sysf_rseg_find_page_no(ulint rseg_id) {

#ifdef WITH_WSREP

#define WSREP_UUID_SIZE 16
Copy link

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) &&
Copy link

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

// ut_ad((current_thd && wsrep_thd_is_in_nbo(current_thd)) ||
// xid_seqno >= trx_sys_cur_xid_seqno);
} else {
memcpy(trx_sys_cur_xid_uuid, xid_uuid, 16);
Copy link

Choose a reason for hiding this comment

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

⚠️ readability-magic-numbers ⚠️
16 is a magic number; consider replacing it with a named constant

}
trx_sys_cur_xid_seqno = xid_seqno;

char uuid_str[40] = { 0, };
Copy link

Choose a reason for hiding this comment

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

⚠️ readability-magic-numbers ⚠️
40 is a magic number; consider replacing it with a named constant

trx_sys_cur_xid_seqno = xid_seqno;

char uuid_str[40] = { 0, };
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str,
Copy link

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

trx_sys_cur_xid_seqno = xid_seqno;

char uuid_str[40] = { 0, };
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str,
Copy link

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,
wsrep_uuid_print(reinterpret_cast<const wsrep_uuid_t *>(xid_uuid), uuid_str,

} else {
#ifdef UNIV_DEBUG
Copy link

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 */
}
Copy link

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
}

Copy link
Contributor

@venkatesh-prasad-v venkatesh-prasad-v left a comment

Choose a reason for hiding this comment

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

LGTM. Please make sure Jenkins is clean and don't forget to squash the commits.

@kamil-holubicki kamil-holubicki changed the title PXC-4498: PXC node "stalls" and causes the cluster to stop responding (8.0) PXC-4498: PXC node "stalls" and causes the cluster to stop responding Feb 7, 2025
@kamil-holubicki
Copy link
Contributor Author

https://perconadev.atlassian.net/browse/PXC-4498
https://perconadev.atlassian.net/browse/PXC-4390

Removed wsrep_group_commit_queue.

The queue works only for variables used for debug assertions. The actual
write to sys_header is done without the protection of the queue.

As the queue is not enforcing proper order of xid storing in sys_header,
but was in the past and still is the source of deadlocks - removing.
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/1)

}
trx_sys_cur_xid_seqno = xid_seqno;

char uuid_str[40] = {
Copy link

Choose a reason for hiding this comment

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

⚠️ readability-magic-numbers ⚠️
40 is a magic number; consider replacing it with a named constant

char uuid_str[40] = {
0,
};
wsrep_uuid_print((const wsrep_uuid_t *)xid_uuid, uuid_str, sizeof(uuid_str));
Copy link

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));
Copy link

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

@kamil-holubicki kamil-holubicki merged commit a37608c into percona:8.0 Feb 10, 2025
20 of 25 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