Common SQL Errors

MySQL Error 3101: ER_TRANSACTION_ROLLBACK_DURING_COMMIT - How to Fix and Prevent

Galaxy Team
August 8, 2025

The transaction was rolled back during COMMIT because Group Replication detected a conflict that failed certification.

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 3101 ER_TRANSACTION_ROLLBACK_DURING_COMMIT?

ER_TRANSACTION_ROLLBACK_DURING_COMMIT happens when MySQL Group Replication rejects a transaction at commit time after conflict detection. Check group_replication_consistency, review conflicting writes, and retry the transaction or adjust conflict-handling settings to resolve the issue.

Error Highlights

Typical Error Message

ER_TRANSACTION_ROLLBACK_DURING_COMMIT

Error Type

Transaction Error

Language

MySQL

Symbol

transaction. When using Group Replication, this means that a transaction failed the group certification process, due to one or more members detecting a potential conflict, and was thus rolled back. See Group Replication. ER_TRANSACTION_ROLLBACK_DURING_COMMIT was added in 5.7.6.

Error Code

3101

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3101 ER_TRANSACTION_ROLLBACK_DURING_COMMIT?

MySQL raises error 3101 when the Group Replication plugin aborts a COMMIT because another member reported a conflicting transaction. The server rolls the local transaction back to preserve data consistency across the group.

The error only appears on servers that run MySQL 5.7.6 or later with Group Replication enabled. Stand-alone instances will never emit this code.

What Causes This Error?

Group certification compares writesets from every member. If two writesets touch overlapping primary keys or unique indexes, the later transaction is rejected with error 3101.

Misconfigured group_replication_consistency, clock skew, or network partitions can widen the conflict window and increase the likelihood of certification failures.

How to Fix ER_TRANSACTION_ROLLBACK_DURING_COMMIT

First, identify the conflicting rows by examining the writeset history in performance_schema.replication_applier_status_by_worker or the binary log.

Next, replay or retry the rejected transaction on a fresh connection. If conflicts recur, refactor the workload to reduce simultaneous updates on the same keys.

Common Scenarios and Solutions

High-throughput OLTP systems often issue concurrent UPDATEs on hot rows like counters. Introducing row-level sharding or using INSERT ... ON DUPLICATE KEY UPDATE with deterministic statements can lower conflicts.

Long-running transactions that lock many rows increase the chance of overlap. Commit in smaller batches to minimize certification failures.

Best Practices to Avoid This Error

Design applications to keep transactions short and idempotent so that automatic retries succeed safely.

Monitor performance_schema.replication_group_member_stats and enable alerts in Galaxy to flag rising conflict rates before they escalate.

Related Errors and Solutions

Error 3090 (ER_LOCK_WAS_NOT_GRANTED) surfaces when a transaction cannot obtain local locks, while error 3102 (ER_TRANSACTION_WITH_WRONG_COORD) indicates coordination issues during replication. Their fixes differ but share the need for careful transaction design.

Common Causes

Hot Row Contention

Frequent writes to the same primary key across multiple members cause overlapping writesets and certification rejection.

Long Transactions

Transactions that touch many rows stay open longer, widening the window for conflicts.

Clock Skew or Network Lag

Out-of-sync clocks or high network latency delay writeset delivery, increasing conflict probability.

Improper Consistency Settings

Non-deterministic statements without group_replication_consistency = BEFORE_AND_AFTER generate inconsistent writesets that fail certification.

Related Errors

Error 3090 ER_LOCK_WAS_NOT_GRANTED

Occurs when local row locks are unavailable, unrelated to group certification.

Error 3102 ER_TRANSACTION_WITH_WRONG_COORD

Indicates the transaction coordinator was not the expected member in the group.

Error 3103 ER_THIRD_PARTY_LOGIN

Generated when an external plugin vetoes a transaction, sometimes confused with 3101.

FAQs

Is error 3101 fatal to the cluster?

No. The error only affects the local transaction. The cluster stays healthy because the conflict was correctly resolved.

Can I disable conflict detection?

No. Group Replication always certifies transactions to guarantee consistency. You can only reduce conflicts by changing workload patterns.

How many times should I retry a transaction?

Most applications succeed within three retries. Monitor your specific workload and adjust the retry limit based on observed conflict rates.

How does Galaxy help?

Galaxy highlights rollback-during-commit errors in the query history, suggests retry-safe patterns, and surfaces replication metrics so you can act before conflicts spike.

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