The MySQL probe component cannot distinguish between the rdonly and replica roles. In the current WeScale-MySQL cluster, there will be no rdonly type vttablets.
The reason is that in MySQL, both the replica and rdonly roles set the read_only system variable to 1.
Proposal
The rdonly role can be set either through flag parameters when the vttablet starts, or through external API calls after the vttablet has started. In the role detection module, if the current case is identified as a Wescale-MySQL cluster and the vttablet role type is rdonly, the type of the vttablet will no longer be obtained from the MySQL probe.
This approach means that once a vttablet is assigned the rdonly role, its type can only be changed through external API calls. Considering the purpose of the rdonly role, this approach seems reasonable.
Background
The
MySQL probe component
cannot distinguish between the rdonly and replica roles. In the current WeScale-MySQL cluster, there will be no rdonly type vttablets.The reason is that in MySQL, both the replica and rdonly roles set the
read_only
system variable to 1.Proposal
The rdonly role can be set either through flag parameters when the vttablet starts, or through external API calls after the vttablet has started. In the role detection module, if the current case is identified as a Wescale-MySQL cluster and the vttablet role type is
rdonly
, the type of the vttablet will no longer be obtained from the MySQL probe.This approach means that once a vttablet is assigned the
rdonly
role, its type can only be changed through external API calls. Considering the purpose of therdonly
role, this approach seems reasonable.