Bug #118412 DML succeeds on Semi-sync without Replicas if Source is stopped
Submitted: 10 Jun 23:24 Modified: 1 Jul 8:44
Reporter: Juan Arruti Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.41, 8.0.42 OS:Any
Assigned to: CPU Architecture:Any

[10 Jun 23:24] Juan Arruti
Description:
When a semi-sync Source loses connection with Replicas, an INSERT succeeds if the database is stopped.

Divergences may be introduced in cases where automatic failover is in place.

How to repeat:
Deploy a Source database with two replicas using semi-sync replication.

# Source
mysql> select @@version ;
+-----------+
| @@version |
+-----------+
| 8.0.41    |
+-----------+
1 row in set (0.00 sec)

mysql> set global rpl_semi_sync_source_timeout=1000000000;
Query OK, 0 rows affected (0.00 sec)

mysql> create database test ;
Query OK, 1 row affected (0.00 sec)

mysql> use test;
Database changed

mysql> create table t1 (c1 integer auto_increment primary key, c2 integer);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 (c2) values (1);
Query OK, 1 row affected (0.00 sec)

# Replica 1
mysql> STOP REPLICA IO_THREAD;
Query OK, 0 rows affected (0.00 sec)

# Replica 2
mysql> STOP REPLICA IO_THREAD;
Query OK, 0 rows affected (0.00 sec)

# Source - it hangs
mysql> insert into t1 (c2) values (2);

# Kill the Source database
$ ps -ef | grep mysql
mysql       5472       1  0 22:20 ?        00:00:01 /usr/sbin/mysqld

$ kill -15 5472

# DML succeeds
mysql> insert into t1 (c2) values (2);
Query OK, 1 row affected (20.67 sec)

$ systemctl start mysqld

mysql> select * from t1 ;
+----+------+
| c1 | c2   |
+----+------+
|  1 |    1 |
|  2 |    2 |
+----+------+
2 rows in set (0.01 sec)
[13 Jun 16:05] Pep Pla
This behavior is also seen if the source is stopped using the shutdown command. In that case, the following warning is displayed in the error log.

2025-06-13T09:40:21.009783Z 10 [Warning] [MY-011145] [Repl] SEMISYNC: Forced shutdown. Some updates might not be replicated.

This message should be an error, not a warning, as this signals the risk of data loss.
[1 Jul 8:44] MySQL Verification Team
Hello Juan Arruti,

Thank you for the report and steps.
Verified as described.

regards,
Umesh