@@ -34,6 +34,15 @@ type MySQLConfig struct {
3434
3535// Config contains all mysync configuration
3636type Config struct {
37+ // We need only few timeout settings:
38+ // - Fast (read sqls, 5 sec),
39+ // - Meduim (modifying sqls, start-stop, etc, 30 sec)
40+ // - perhaps, Long (?)
41+ // Let's start with meduim...
42+
43+ // 30 sec timeout - sql, etc
44+ MedTimeout time.Duration `config:"m_timeout" yaml:"m_timeout"`
45+
3746 DevMode bool `config:"dev_mode" yaml:"dev_mode"`
3847 SemiSync bool `config:"semi_sync" yaml:"semi_sync"`
3948 SemiSyncEnableLag int64 `config:"semi_sync_enable_lag" yaml:"semi_sync_enable_lag"`
@@ -58,16 +67,10 @@ type Config struct {
5867 DcsWaitTimeout time.Duration `config:"dcs_wait_timeout" yaml:"dcs_wait_timeout"`
5968 DBTimeout time.Duration `config:"db_timeout" yaml:"db_timeout"`
6069 DBLostCheckTimeout time.Duration `config:"db_lost_check_timeout" yaml:"db_lost_check_timeout"`
61- DBSetRoTimeout time.Duration `config:"db_set_ro_timeout" yaml:"db_set_ro_timeout"`
62- DBSetRoForceTimeout time.Duration `config:"db_set_ro_force_timeout" yaml:"db_set_ro_force_timeout"`
63- DBStopSlaveSQLThreadTimeout time.Duration `config:"db_stop_slave_sql_thread_timeout" yaml:"db_stop_slave_sql_thread_timeout"`
6470 TickInterval time.Duration `config:"tick_interval" yaml:"tick_interval"`
6571 HealthCheckInterval time.Duration `config:"healthcheck_interval" yaml:"healthcheck_interval"`
66- InfoFileHandlerInterval time.Duration `config:"info_file_handler_interval" yaml:"info_file_handler_interval"`
6772 RecoveryCheckInterval time.Duration `config:"recoverycheck_interval" yaml:"recoverycheck_interval"`
6873 ExternalCAFileCheckInterval time.Duration `config:"external_ca_file_check_interval" yaml:"external_ca_file_check_interval"`
69- ManagerElectionDelayAfterQuorumLoss time.Duration `config:"manager_election_delay_after_quorum_loss" yaml:"manager_election_delay_after_quorum_loss"`
70- ManagerLockAcquireDelayAfterQuorumLoss time.Duration `config:"manager_lock_acquire_delay_after_quorum_loss" yaml:"manager_lock_acquire_delay_after_quorum_loss"`
7174 MaxAcceptableLag float64 `config:"max_acceptable_lag" yaml:"max_acceptable_lag"`
7275 SlaveCatchUpTimeout time.Duration `config:"slave_catch_up_timeout" yaml:"slave_catch_up_timeout"`
7376 DisableSemiSyncReplicationOnMaintenance bool `config:"disable_semi_sync_replication_on_maintenance" yaml:"disable_semi_sync_replication_on_maintenance"`
@@ -123,6 +126,7 @@ func DefaultConfig() (Config, error) {
123126 return Config {}, err
124127 }
125128 config := Config {
129+ MedTimeout : 30 * time .Second ,
126130 DevMode : false ,
127131 SemiSync : false ,
128132 SemiSyncEnableLag : 100 * 1024 * 1024 , // 100Mb
@@ -156,18 +160,12 @@ func DefaultConfig() (Config, error) {
156160 DcsWaitTimeout : 10 * time .Second ,
157161 DBTimeout : 5 * time .Second ,
158162 DBLostCheckTimeout : 5 * time .Second ,
159- DBSetRoTimeout : 30 * time .Second ,
160- DBSetRoForceTimeout : 30 * time .Second ,
161163 DisableSetReadonlyOnLost : false ,
162164 ResetupCrashedHosts : false ,
163- DBStopSlaveSQLThreadTimeout : 30 * time .Second ,
164165 TickInterval : 5 * time .Second ,
165166 HealthCheckInterval : 5 * time .Second ,
166- InfoFileHandlerInterval : 30 * time .Second ,
167167 RecoveryCheckInterval : 5 * time .Second ,
168168 ExternalCAFileCheckInterval : 5 * time .Second ,
169- ManagerElectionDelayAfterQuorumLoss : 30 * time .Second , // need more than 15 sec
170- ManagerLockAcquireDelayAfterQuorumLoss : 45 * time .Second ,
171169 MaxAcceptableLag : 60.0 ,
172170 SlaveCatchUpTimeout : 30 * time .Minute ,
173171 DisableSemiSyncReplicationOnMaintenance : true ,
0 commit comments