Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit d219844

Browse files
authored
Merge pull request #1207 from luisyonaldo/semi-sync-master-timeout
fix out of range in semi_sync_master_timeout
2 parents f68e7f0 + 0af5fb2 commit d219844

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

go/db/generate_patches.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,9 @@ var generateSQLPatches = []string{
576576
database_instance
577577
ADD COLUMN semi_sync_available TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_enforced
578578
`,
579+
`
580+
ALTER TABLE /* sqlite3-skip */
581+
database_instance
582+
MODIFY semi_sync_master_timeout BIGINT UNSIGNED NOT NULL DEFAULT 0
583+
`,
579584
}

go/inst/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type Instance struct {
9797
SemiSyncEnforced bool
9898
SemiSyncMasterEnabled bool
9999
SemiSyncReplicaEnabled bool
100-
SemiSyncMasterTimeout uint
100+
SemiSyncMasterTimeout uint64
101101
SemiSyncMasterWaitForReplicaCount uint
102102
SemiSyncMasterStatus bool
103103
SemiSyncMasterClients uint

go/inst/instance_dao.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func ReadTopologyInstanceBufferable(instanceKey *InstanceKey, bufferWrites bool,
429429
instance.SemiSyncMasterEnabled = (m.GetString("Value") == "ON")
430430
semiSyncMasterPluginLoaded = true
431431
} else if m.GetString("Variable_name") == "rpl_semi_sync_master_timeout" {
432-
instance.SemiSyncMasterTimeout = m.GetUint("Value")
432+
instance.SemiSyncMasterTimeout = m.GetUint64("Value")
433433
} else if m.GetString("Variable_name") == "rpl_semi_sync_master_wait_for_slave_count" {
434434
instance.SemiSyncMasterWaitForReplicaCount = m.GetUint("Value")
435435
} else if m.GetString("Variable_name") == "rpl_semi_sync_slave_enabled" {
@@ -1139,7 +1139,7 @@ func readInstanceRow(m sqlutils.RowMap) *Instance {
11391139
instance.SemiSyncEnforced = m.GetBool("semi_sync_enforced")
11401140
instance.SemiSyncAvailable = m.GetBool("semi_sync_available")
11411141
instance.SemiSyncMasterEnabled = m.GetBool("semi_sync_master_enabled")
1142-
instance.SemiSyncMasterTimeout = m.GetUint("semi_sync_master_timeout")
1142+
instance.SemiSyncMasterTimeout = m.GetUint64("semi_sync_master_timeout")
11431143
instance.SemiSyncMasterWaitForReplicaCount = m.GetUint("semi_sync_master_wait_for_slave_count")
11441144
instance.SemiSyncReplicaEnabled = m.GetBool("semi_sync_replica_enabled")
11451145
instance.SemiSyncMasterStatus = m.GetBool("semi_sync_master_status")

0 commit comments

Comments
 (0)