-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support async replication #88
Changes from 1 commit
55dd18b
4dfafc3
afefe5c
3a4dcb0
62a430a
71f4403
091024c
b685481
2bfb126
e88784d
a155b32
27b7834
00bdd06
81a0f60
3f44fc7
c741698
9b8d7a3
302ff31
b8a90db
7425ad9
3481208
51782c9
6f9a218
5efe22e
928e140
de6a36e
26efe42
9e9a083
7a878b3
4faacd9
428b272
31cfffb
b7b0b32
c5e08fb
68c8a96
2de37a7
24f2840
7fddbdd
d9ba04f
9fd2bd6
723d4db
1468bb5
6937a8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,8 @@ | |
ReplicationChannel string `config:"replication_channel" yaml:"replication_channel"` | ||
ExternalReplicationChannel string `config:"external_replication_channel" yaml:"external_replication_channel"` | ||
ExternalReplicationType util.ExternalReplicationType `config:"external_replication_type" yaml:"external_replication_type"` | ||
ASync bool `config:"a_sync" yaml:"a_sync"` | ||
ASyncAllowedLag int64 `config:"a_sync_allowed_lag" yaml:"a_sync_allowed_lag"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New setting which will allow client to set server in async mode. In async mode in case of failover mysync will promote slave to new master even if it has replication delay, but only if delay less then ASyncAllowedLag |
||
} | ||
|
||
// DefaultConfig returns default configuration for MySync | ||
|
@@ -164,6 +166,8 @@ | |
ReplicationChannel: "", | ||
ExternalReplicationChannel: "external", | ||
ExternalReplicationType: util.Disabled, | ||
ASync: false, | ||
ASyncAllowedLag: 0, | ||
} | ||
return config, nil | ||
} | ||
|
@@ -205,5 +209,8 @@ | |
if cfg.NotCriticalDiskUsage > cfg.CriticalDiskUsage { | ||
return fmt.Errorf("not_critical_disk_usage should be <= critical_disk_usage") | ||
} | ||
if cfg.SemiSync && cfg.ASync { | ||
return fmt.Errorf("can't run in both semisync and async mode") | ||
} | ||
return nil | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,8 @@ | |
querySetInnodbFlushLogAtTrxCommit = "set_innodb_flush_log_at_trx_commit" | ||
querySetSyncBinlog = "set_sync_binlog" | ||
queryGetReplicationSettings = "get_replication_settings" | ||
queryGetMdbReplMonTs = "get_mdb_repl_mon_ts" | ||
queryCalcMdbReplMonTsDelay = "calc_mdb_repl_mon_ts_delay" | ||
) | ||
|
||
var DefaultQueries = map[string]string{ | ||
|
@@ -123,4 +125,6 @@ | |
querySetInnodbFlushLogAtTrxCommit: `SET GLOBAL innodb_flush_log_at_trx_commit = :level`, | ||
queryGetReplicationSettings: `SELECT @@innodb_flush_log_at_trx_commit as InnodbFlushLogAtTrxCommit, @@sync_binlog as SyncBinlog`, | ||
querySetSyncBinlog: `SET GLOBAL sync_binlog = :sync_binlog`, | ||
queryGetMdbReplMonTs: `SELECT UNIX_TIMESTAMP(ts) AS ts FROM mysql.mdb_repl_mon`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one looks very specific to your installation. Probably, we should use data from |
||
queryCalcMdbReplMonTsDelay: `SELECT UNIX_TIMESTAMP(CURRENT_TIMESTAMP(0)) - CAST(:ts AS DECIMAL(20,0)) AS delay`, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should explicitly mention "in dcs"