@@ -325,9 +325,9 @@ func (proxy *ProxySQLProxy) Refresh() error {
325
325
if cluster .Conf .ProxysqlBootstrap && cluster .IsDiscovered () {
326
326
// if ProxySQL and replication-manager states differ, resolve the conflict
327
327
if bke .PrxStatus == "OFFLINE_HARD" && s .State == stateSlave && ! s .IsIgnored () {
328
- if cluster .Conf .ProxysqlDebug {
329
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlInfo , "Monitor ProxySQL setting online as reader rejoining server %s" , s .URL )
330
- }
328
+ // if cluster.Conf.ProxysqlDebug {
329
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL setting online as reader rejoining server %s" , s .URL )
330
+ // }
331
331
err = psql .SetReader (misc .Unbracket (s .Host ), s .Port )
332
332
if err != nil {
333
333
cluster .StateMachine .AddState ("ERR00069" , state.State {ErrType : "WARNING" , ErrDesc : fmt .Sprintf (clusterError ["ERR00069" ], s .URL , err ), ErrFrom : "PRX" , ServerUrl : proxy .Name })
@@ -336,9 +336,9 @@ func (proxy *ProxySQLProxy) Refresh() error {
336
336
}
337
337
338
338
if s .IsSlaveOrSync () && s .IsMaintenance && isFoundBackendRead && bke .PrxStatus == "ONLINE" {
339
- if cluster .Conf .ProxysqlDebug {
340
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlInfo , "Monitor ProxySQL replicat %s Offline SOFT from reader group cause by maintenance " , s .URL )
341
- }
339
+ // if cluster.Conf.ProxysqlDebug {
340
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL replicat %s Offline SOFT from reader group cause by maintenance " , s .URL )
341
+ // }
342
342
err = psql .SetOfflineSoft (misc .Unbracket (s .Host ), s .Port )
343
343
updated = true
344
344
}
@@ -383,9 +383,9 @@ func (proxy *ProxySQLProxy) Refresh() error {
383
383
384
384
} else if s .IsLeader () && ! isFoundBackendRead && (cluster .Configurator .HasProxyReadLeader () || (cluster .Configurator .HasProxyReadLeaderNoSlave () && cluster .HasNoValidSlave ())) {
385
385
// Add leader in reader group if not found and setup
386
- if cluster .Conf .ProxysqlDebug {
387
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlInfo , "Monitor ProxySQL add leader in reader group in %s" , s .URL )
388
- }
386
+ // if cluster.Conf.ProxysqlDebug {
387
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL add leader in reader group in %s" , s .URL )
388
+ // }
389
389
err = psql .AddServerAsReader (misc .Unbracket (s .Host ), s .Port , "1" , strconv .Itoa (s .ClusterGroup .Conf .PRXServersBackendMaxReplicationLag ), strconv .Itoa (s .ClusterGroup .Conf .PRXServersBackendMaxConnections ), strconv .Itoa (misc .Bool2Int (s .ClusterGroup .Conf .PRXServersBackendCompression )), proxy .UseSSL ())
390
390
if err != nil {
391
391
cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlErr , "ProxySQL could not add reader %s (%s)" , s .URL , err )
@@ -395,9 +395,9 @@ func (proxy *ProxySQLProxy) Refresh() error {
395
395
// Drop the leader in reader group if not found and setup
396
396
// Cancel learder remove because no valid reader
397
397
if ! cluster .Configurator .HasProxyReadLeaderNoSlave () || (cluster .Configurator .HasProxyReadLeaderNoSlave () && ! cluster .HasNoValidSlave ()) {
398
- if cluster .Conf .ProxysqlDebug {
399
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlInfo , "Monitor ProxySQL Drop the leader in reader group from %s" , s .URL )
400
- }
398
+ // if cluster.Conf.ProxysqlDebug {
399
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL Drop the leader in reader group from %s" , s .URL )
400
+ // }
401
401
err = psql .DropReader (misc .Unbracket (s .Host ), s .Port )
402
402
if err != nil {
403
403
cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlErr , "ProxySQL could not drop reader in %s (%s)" , s .URL , err )
@@ -406,9 +406,9 @@ func (proxy *ProxySQLProxy) Refresh() error {
406
406
}
407
407
} else if s .IsSlaveOrSync () && ! s .IsIgnored () && (s .PrevState == stateUnconn || s .PrevState == stateFailed ) {
408
408
err = psql .SetReader (misc .Unbracket (s .Host ), s .Port )
409
- if cluster .Conf .ProxysqlDebug {
410
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL setting reader standalone server %s" , s .URL )
411
- }
409
+ // if cluster.Conf.ProxysqlDebug {
410
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlDbg , "Monitor ProxySQL setting reader standalone server %s" , s .URL )
411
+ // }
412
412
if err != nil {
413
413
cluster .StateMachine .AddState ("ERR00072" , state.State {ErrType : "WARNING" , ErrDesc : fmt .Sprintf (clusterError ["ERR00072" ], proxy .Name , s .URL , err ), ErrFrom : "PRX" , ServerUrl : proxy .Name })
414
414
}
@@ -422,7 +422,7 @@ func (proxy *ProxySQLProxy) Refresh() error {
422
422
// //Set the alert if proxysql status is OFFLINE_SOFT
423
423
if (bke .PrxStatus == "OFFLINE_SOFT" || bkeread .PrxStatus == "OFFLINE_SOFT" ) && ! s .IsMaintenance {
424
424
if ! cluster .StateMachine .IsInState ("ERR00091" ) {
425
- cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlInfo , clusterError ["ERR00091" ], proxy .Name , s .URL )
425
+ cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModProxySQL , config .LvlWarn , clusterError ["ERR00091" ], proxy .Name , s .URL )
426
426
}
427
427
cluster .StateMachine .AddState ("ERR00091" , state.State {ErrType : "WARNING" , ErrDesc : fmt .Sprintf (clusterError ["ERR00091" ], proxy .Name , s .URL ), ErrFrom : "PRX" , ServerUrl : proxy .Name })
428
428
// s.SwitchMaintenance()
0 commit comments