Bug #86261 Read-only connect fails if there are no read-only nodes
Submitted: 10 May 2017 6:53 Modified: 10 Jan 2018 2:11
Reporter: Mario Beck Email Updates:
Status: Closed Impact on me:
Category:MySQL Router Severity:S3 (Non-critical)
Version:2.1.3 OS:Oracle Linux
Assigned to: CPU Architecture:Any
Tags: InnoDB Cluster, read-only

[10 May 2017 6:53] Mario Beck
Port 6447 loadbalances between secondary slaves.
If there is no secondary available (only one node left) I get no connections via port 6447. I would prefer that in this (rare) case the connection goes to the primary. Otherwise an application that uses read-only will fail although there is one node up and running.

Even worse if you run in multi-primary mode: No connection possible via 6447.

How to repeat:
Create a sandbox InnoDB Cluster with three nodes, setup router.
Shutdown two nodes of the cluster. Try to connect to Router on port 6447.

Alternatively deploy an InnoDB Cluster with three nodes in multi-primary mode. Setup router. Try to connect to router via port 6447. No connection possible.

Suggested fix:
If there is no R/O node available router should fall back and use R/W nodes even for read access.
[11 May 2017 17:42] MySQL Verification Team

Thanks for your report, verified as reported.

all best
[10 Jan 2018 2:11] Philip Olson
Posted by developer:
Fixed as of the upcoming MySQL Router 8.0.4 release, and here's the changelog entry:

The optional routing_strategy configuration option was added. The
available values are first-available, next-available, round-robin, and

Previously, these strategies
were described as scheduling modes by the mode configuration option where
the read-write mode defaults to the first-available strategy, and the
read-only mode defaults to the round-robin strategy. This preserves
previous behavior for these modes.

Thank you for the bug report.