ReplicationThreadState: multi-valued logic#767
Conversation
|
Added |
|
Just to clarify the purpose of #763: #763 is not solely about the fact that the IO thread can be in the "Connecting" state, but that the logic of determining the replication status was incomplete. If true is
Then the opposite of that, based on the distribution rules of negation, is:
This then leads to all the states that the logic would say replication is stopped:
And that was the concern, more than just the extra value that Slave_IO_Running can be. This PR looks like it's dealing with all of that so far; this is just to document the extent of the reasoning for anyone reading this. |
Fixes #763
Until today, replication thread state was a boolean:
truewhen running,falseotherwise. However, a IO thread could also be in aConnectingstate, which is neither running nor stopped. And this state, as described in #763, can lead to wrong assumptions.This PR introduces multi-valued logic.
ReplicationthreadStateis introduced, which can be:ReplicationthreadStateStoppedReplicationthreadStateRunningReplicationthreadStateOtherIn this initial commit, most critical existing logic has been converted to use these states as opposed to relying on a boolean value.
There's more places in the code to modify, in next commits.
cc @ggunson