From af7a19b7b358afea339e18920b28bf8b3f0cf314 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 2 Dec 2015 15:23:55 +0200 Subject: [PATCH] Reduce logging of binlog server Only the true state changes of a slave - up-to-date -> catch-up or catch-up to up-to-date - are logged. --- server/modules/routing/binlog/blr_master.c | 2 +- server/modules/routing/binlog/blr_slave.c | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/server/modules/routing/binlog/blr_master.c b/server/modules/routing/binlog/blr_master.c index eeeb8f772..d2ffff937 100644 --- a/server/modules/routing/binlog/blr_master.c +++ b/server/modules/routing/binlog/blr_master.c @@ -1723,7 +1723,7 @@ unsigned int cstate; spinlock_release(&slave->catch_lock); if ((cstate & CS_UPTODATE) == CS_UPTODATE) { - MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up to date to catch-up in blr_distribute_binlog_record, binlog file '%s', position %lu.", + MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up-to-date to catch-up in blr_distribute_binlog_record, binlog file '%s', position %lu.", router->service->name, slave->dcb->remote, ntohs((slave->dcb->ipv4).sin_port), diff --git a/server/modules/routing/binlog/blr_slave.c b/server/modules/routing/binlog/blr_slave.c index 632808dfe..1ba058c15 100644 --- a/server/modules/routing/binlog/blr_slave.c +++ b/server/modules/routing/binlog/blr_slave.c @@ -2122,7 +2122,7 @@ char read_errmsg[BINLOG_ERROR_MSG_LEN+1]; if ((cstate & CS_UPTODATE) == CS_UPTODATE) { - MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up to date to catch-up in blr_slave_catchup, binlog file '%s', position %lu.", + MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up-to-date to catch-up in blr_slave_catchup, binlog file '%s', position %lu.", router->service->name, slave->dcb->remote, ntohs((slave->dcb->ipv4).sin_port), @@ -2271,15 +2271,6 @@ unsigned int cstate; spinlock_release(&router->binlog_lock); if (do_return) { - if ((slave->cstate & CS_EXPECTCB) == CS_EXPECTCB) - { - MXS_NOTICE("%s: Slave %s:%d, server-id %d transition to expect_call_back in blr_slave_callback, binlog file '%s', position %lu.", - router->service->name, - slave->dcb->remote, - ntohs((slave->dcb->ipv4).sin_port), - slave->serverid, - slave->binlogfile, (unsigned long)slave->binlog_pos); - } spinlock_acquire(&slave->catch_lock); slave->cstate |= CS_EXPECTCB; spinlock_release(&slave->catch_lock); @@ -2295,7 +2286,7 @@ unsigned int cstate; if ((cstate & CS_UPTODATE) == CS_UPTODATE) { - MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up to date to catch-up in blr_slave_callback, binlog file '%s', position %lu.", + MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up-to-date to catch-up in blr_slave_callback, binlog file '%s', position %lu.", router->service->name, slave->dcb->remote, ntohs((slave->dcb->ipv4).sin_port),