Skip to content

Support for source_retry_count and master_retry_count in replication ? #1277

@dibrother

Description

@dibrother

Question:
Due to the default value of 10 for MySQL 8.4 Source-Retry-Count, if the main server fails to connect within 10 attempts after a crash, it will cause the io_thread to permanently fail to connect. Therefore, I have changed the value of Source-Retry-Count to 10080.
After switching or error recovery, when configuring the master-slave relationship in the replication manager, Source_SetryCount is not set, and the value of the slave library is set to 10 by default.
Is there a parameter that can modify this setting value?

before switching:

Replica_IO_State: Waiting for source to send event
                  Source_Host: 10.10.2.11
                  Source_User: repl_user
                  Source_Port: 3310
                Connect_Retry: 60
              Source_Log_File: binlog.000001
          Read_Source_Log_Pos: 4971370
               Relay_Log_File: test12-relay-bin.000002
                Relay_Log_Pos: 4945673
        Relay_Source_Log_File: binlog.000001
           Replica_IO_Running: Yes
          Replica_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Source_Log_Pos: 4945462
              Relay_Log_Space: 4971793
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Source_SSL_Allowed: Yes
           Source_SSL_CA_File: 
           Source_SSL_CA_Path: 
              Source_SSL_Cert: 
            Source_SSL_Cipher: 
               Source_SSL_Key: 
        Seconds_Behind_Source: 0
Source_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Source_Server_Id: 211
                  Source_UUID: fa382b76-cb68-11f0-8af6-000c29532d30
             Source_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
    Replica_SQL_Running_State: Waiting for replica workers to process their queues
           Source_Retry_Count: 10080                    --------------------------10080------------------------------------
                  Source_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Source_SSL_Crl: 
           Source_SSL_Crlpath: 
           Retrieved_Gtid_Set: fa382b76-cb68-11f0-8af6-000c29532d30:1-13052
            Executed_Gtid_Set: fa382b76-cb68-11f0-8af6-000c29532d30:1-13047
                Auto_Position: 1
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Source_TLS_Version: 
       Source_public_key_path: 
        Get_Source_public_key: 0
            Network_Namespace: 

alter switching:

Replica_IO_State: Waiting for source to send event
                  Source_Host: 10.10.2.12
                  Source_User: repl_user
                  Source_Port: 3310
                Connect_Retry: 5
              Source_Log_File: binlog.000001
          Read_Source_Log_Pos: 7615115
               Relay_Log_File: test11-relay-bin.000002
                Relay_Log_Pos: 413
        Relay_Source_Log_File: binlog.000001
           Replica_IO_Running: Yes
          Replica_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Source_Log_Pos: 7615115
              Relay_Log_Space: 625
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Source_SSL_Allowed: Yes
           Source_SSL_CA_File: 
           Source_SSL_CA_Path: 
              Source_SSL_Cert: 
            Source_SSL_Cipher: 
               Source_SSL_Key: 
        Seconds_Behind_Source: 0
Source_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Source_Server_Id: 212
                  Source_UUID: 0c596987-cb69-11f0-9b1f-000c293d1396
             Source_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
    Replica_SQL_Running_State: Replica has read all relay log; waiting for more updates
           Source_Retry_Count: 10                            -----------------------------------set to 10---------------------
                  Source_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Source_SSL_Crl: 
           Source_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: fa382b76-cb68-11f0-8af6-000c29532d30:1-20311
                Auto_Position: 1
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Source_TLS_Version: 
       Source_public_key_path: 
        Get_Source_public_key: 0
            Network_Namespace:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions