Common SQL Errors

MySQL Error 3191: ER_GROUP_REPLICATION_MAX_GROUP_SIZE - Causes, Fixes, and Prevention

Galaxy Team
August 8, 2025

START GROUP_REPLICATION fails because the group already reached the maximum member limit defined by group_replication_group_size.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 3191 (ER_GROUP_REPLICATION_MAX_GROUP_SIZE)?

MySQL error 3191 (ER_GROUP_REPLICATION_MAX_GROUP_SIZE) means the START GROUP_REPLICATION command was rejected because the group already contains the maximum allowed members (default 9). Remove inactive members or raise group_replication_group_size, then retry START GROUP_REPLICATION to resolve the problem.

Error Highlights

Typical Error Message

ER_GROUP_REPLICATION_MAX_GROUP_SIZE

Error Type

Replication Error

Language

MySQL

Symbol

group already has 9 members. ER_GROUP_REPLICATION_MAX_GROUP_SIZE was added in 5.7.14.

Error Code

3191

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3191 (ER_GROUP_REPLICATION_MAX_GROUP_SIZE)?

Error 3191, condition ER_GROUP_REPLICATION_MAX_GROUP_SIZE, occurs when you run START GROUP_REPLICATION on a MySQL instance and the target replication group already contains the maximum number of members. The default limit is 9, but it can be configured using group_replication_group_size.

Because the request would exceed the defined limit, MySQL rejects the command and returns SQL state HY000 with the error text shown above. The node remains outside the group, and applications relying on group replication may experience availability issues.

What Causes This Error?

The primary trigger is a mismatch between the current member count and the allowed maximum. If nine servers are already online in the group, any additional START GROUP_REPLICATION command fails immediately.

The limit can also be exceeded unintentionally when ghost members – servers still listed in performance_schema replication tables – were not removed correctly after shutdown, making MySQL believe the group is full.

How to Fix ER_GROUP_REPLICATION_MAX_GROUP_SIZE

The fastest remedy is to reduce the active member count. Stop group replication on an unused instance or remove a stale member with the RECOVER MEMBER action, then retry START GROUP_REPLICATION.

When legitimate capacity growth is needed, raise the group_replication_group_size value consistently on every member, restart the servers, and start replication again. Ensure the plugin variables match across the cluster to avoid compatibility issues.

Common Scenarios and Solutions

During rolling upgrades, temporary servers join and leave quickly. If old nodes do not shut down cleanly, their membership persists, blocking new joins. Use the mysql_innodb_cluster metadata or performance_schema.group_replication_members to detect and clean up phantom entries.

In cloud auto-scaling environments, an instance template may spin up more members than intended. Implement an admission control script that checks current membership before calling START GROUP_REPLICATION to stop the error from surfacing in production.

Best Practices to Avoid This Error

Plan capacity headroom by setting group_replication_group_size slightly higher than the expected steady-state size. Monitor the group_replication_members table to detect unexpected member growth early.

Automate graceful leave operations with STOP GROUP_REPLICATION before terminating a node. Use orchestrators or configuration management tools to keep the group size setting consistent across every server.

Related Errors and Solutions

ER_GROUP_REPLICATION_COMMAND_FAILURE appears when START GROUP_REPLICATION fails for other reasons, such as configuration mismatches. Investigate the detailed diagnostics reported in the Performance Schema tables.

ER_GROUP_REPLICATION_SECONDARY_FAILOVER indicates a problem with automatic primary election. While separate, it can coincide if an oversized group causes instability. Stabilize membership first, then address election issues.

Common Causes

Full member list already at limit

All available slots defined by group_replication_group_size are occupied, so new nodes cannot join.

Stale members still registered

Servers that crashed or were force-stopped remain in the replication metadata, inflating the perceived count.

Mismatched configuration across nodes

One or more servers advertise a higher group size while others retain a lower value, causing join validation to fail.

Automated scaling without quota checks

Cloud automation launches multiple replicas simultaneously without verifying current group size.

Related Errors

ER_GROUP_REPLICATION_COMMAND_FAILURE (Error 3092)

Generic failure when START GROUP_REPLICATION fails for configuration or network reasons.

ER_GROUP_REPLICATION_SECONDARY_FAILOVER (Error 3093)

Indicates a problem electing a new primary. Often surfaces after instability created by incorrect group size changes.

ER_GROUP_REPLICATION_PLUGIN_INSTALLATION_FAILED (Error 3081)

Raised when the replication plugin cannot be loaded, frequently due to plugin mismatch.

FAQs

Can I change group_replication_group_size online?

Yes. Set the variable on every member, then restart each server or use SET PERSIST. All nodes must share the same value before joining.

What is the default maximum group size?

MySQL sets the default to 9 members. Attempting to exceed this limit without adjusting the variable triggers error 3191.

How do I detect ghost members?

Query performance_schema.replication_group_members for members in OFFLINE or ERROR state. Remove them with group_replication_recovery_remove_member.

How does Galaxy help?

The Galaxy SQL editor highlights error 3191 instantly, offers AI-generated fixes, and lets teams version their replication scripts so configuration mismatches do not slip into production.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo