Skip to content

PS-11378 Add more group replication tests - #15

Merged
tplavcic merged 7 commits into
mainfrom
ps-11378-group-repl
Oct 12, 2026
Merged

tplavcic merged 7 commits into
mainfrom
ps-11378-group-repl

Conversation

@tplavcic

@tplavcic tplavcic commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

This covers scenarios from PS-11378 ticket:

  • (1) Provision new node by restoring backup taken using Xtrabackup from an online node and join the GR node into the cluster.
  • (6) Disconnect network on one of secondary nodes and later reconnect it within gr_member_expel_timeout and group_replication_unreachable_majority_timeout seconds and verify that the node is not expelled and it will be back online
  • (7) Disconnect network on primary node and later reconnect it within gr_member_expel_timeout and group_replication_unreachable_majority_timeout seconds and see that the node is not expelled and it will be back online
  • (8) Disconnect network on one of secondary nodes and later reconnect it within gr_member_expel_timeout but after group_replication_unreachable_majority_timeout seconds and see that member expels and it automatically retries joining and successfully joins back as per group_replication_autorejoin_tries(default 3).
  • (9) Disconnect network on primary node and later reconnect it within gr_member_expel_timeout but after group_replication_unreachable_majority_timeout seconds and see that member expels and it automatically retries joining and successfully joins back as per group_replication_autorejoin_tries(default 3). See that a new primary is elected successfully.
  • (10) Disconnect network on primary node and later reconnect it after gr_member_expel_timeout but within group_replication_unreachable_majority_timeout seconds and see that member expels and it automatically retries joining and successfully joins back as per group_replication_autorejoin_tries(default 3). See that a new primary is elected successfully.
  • Test for asynchronous connection between the two GR clusters in case of primary failover in source and replica cluster. (Async channel running with SOURCE_CONNECTION_AUTO_FAILOVER = 1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Async metadata replication and inherited clone history can cause the new tests to fail incorrectly.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Adds PS-11378 coverage for backup-based provisioning, Group Replication isolation timeouts, autorejoin behavior, and asynchronous cluster failover.

Changes:

  • Adds XtraBackup provisioning and timeout-isolation scenarios.
  • Adds asynchronous replication failover tests between two GR clusters.
  • Extends GR helpers for restored nodes, server-ID offsets, and async channels.
File Description
xtrabackup_helper.py Supports preparing full-only backups.
test_provision_from_backup.py Tests provisioning and joining a restored node.
test_isolation_timeouts.py Covers timeout and autorejoin scenarios 6–10.
test_async_failover.py Tests source and replica primary failover.
group_replication_helper.py Adds provisioning, timeout, and async replication helpers.
conftest.py Adds a two-cluster fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Replica-side async failover is not enabled, and restarted replica members can apply unfiltered metadata before filter restoration.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (3)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Enable automatic channel startup on elected replica primary

test_scripts/​ps/​group-replication/​test_async_failover.py:45

SOURCE_CONNECTION_AUTO_FAILOVER can switch a running receiver to another source, but it does not start this channel when a different replica-cluster member is elected primary. Because START REPLICA is issued only on the current primary, the failover="replica" case will leave the new primary's channel stopped unless group_replication_start_failover_channels is enabled on the replica members. Set it before configuring/starting the channel.

Low severity Use effective server ID in startup logs and command

test_scripts/​ps/​group-replication/​group_replication_helper.py:1455

With server_id_offset, this startup command now uses IDs such as 101–103, but the preceding log still reports the unoffset index (1–3). That makes the diagnostics misleading in the new two-cluster tests. Compute the effective server ID once and use it in both the log and command.

@tplavcic
tplavcic merged commit 423b1d4 into main Oct 12, 2026
2 checks passed
@tplavcic
tplavcic deleted the ps-11378-group-repl branch October 12, 2026 12:58
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