Bug #91150 Force primary to stop accept writes on low number of members in the group
Submitted: 5 Jun 2018 16:02 Modified: 1 Aug 2018 0:17
Reporter: Artem Danilov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S4 (Feature request)
Version:8.0.11 OS:Any
Assigned to: CPU Architecture:Any

[5 Jun 2018 16:02] Artem Danilov
Description:
Add an option to force primary to stop accept writes if number of members in the group goes below some threshold. There could be pathological situations (say bugs in automation) which will lead to primary be a single member of the group. This can end up in data losses in case of primary failure as no data is replication beyond single host at this point.

How to repeat:
This is a feature request.

Suggested fix:
Add an option group_replication_group_low_members_threshold which will turn primary into super_read_only mode if number of members in the group goes below the threshold.
[6 Jun 2018 4:28] MySQL Verification Team
Hello Artem,

Thank you for the feature request!

Thanks,
Umesh
[1 Aug 2018 0:17] Artem Danilov
One other use case which came to my mind in addition to bugs in automation is the group replication bootstrap. The group replication is bootstrapped with a single node and more nodes join later. However, if someone was able to send writes before any extra node is joined then these writes are not replicated and could result in data loss if the first node dies hard before any other one joined and caught up.

Probably this use case can be solved by some extra hoops like starting server always with read_only=1 and make it writable only after more nodes are joined. But my point is that the replication of any committed writes is an invariant which MySQL server should hold for any production environment which takes data losses problem serious. Usually quality and testing of some external automation scripts is not as good as MySQL server and bugs of interacting multiple scripts do happen in huge deployments, especially races appearing in some very rare conditions.