Log messages fix with slave ip:port and id
Log messages fix with slave ip:port and id
This commit is contained in:
@ -184,6 +184,7 @@
|
|||||||
#define SLAVE_POS_READ_OK 0x00
|
#define SLAVE_POS_READ_OK 0x00
|
||||||
#define SLAVE_POS_READ_ERR 0xff
|
#define SLAVE_POS_READ_ERR 0xff
|
||||||
#define SLAVE_POS_READ_UNSAFE 0xfe
|
#define SLAVE_POS_READ_UNSAFE 0xfe
|
||||||
|
#define SLAVE_POS_FSTAT_ERR 0xfd
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some useful macros for examining the MySQL Response packets
|
* Some useful macros for examining the MySQL Response packets
|
||||||
|
@ -422,10 +422,9 @@ struct stat statb;
|
|||||||
filelen = statb.st_size;
|
filelen = statb.st_size;
|
||||||
else {
|
else {
|
||||||
if (file->fd == -1) {
|
if (file->fd == -1) {
|
||||||
hdr->ok = SLAVE_POS_READ_OK;
|
hdr->ok = SLAVE_POS_FSTAT_ERR;
|
||||||
snprintf(errmsg, BINLOG_ERROR_MSG_LEN, "blr_read_binlog called with invalid file->fd, pos %lu", pos);
|
snprintf(errmsg, BINLOG_ERROR_MSG_LEN, "blr_read_binlog called with invalid file->fd, pos %lu", pos);
|
||||||
spinlock_release(&file->lock);
|
spinlock_release(&file->lock);
|
||||||
MXS_ERROR("Slave has failed fstat %s", errmsg);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2024,6 +2024,16 @@ char read_errmsg[BINLOG_ERROR_MSG_LEN+1];
|
|||||||
if (record == NULL) {
|
if (record == NULL) {
|
||||||
slave->stats.n_failed_read++;
|
slave->stats.n_failed_read++;
|
||||||
|
|
||||||
|
if (hdr.ok == SLAVE_POS_FSTAT_ERR) {
|
||||||
|
MXS_ERROR("%s Slave %s:%i, server-id %d, binlog '%s', %s",
|
||||||
|
router->service->name,
|
||||||
|
slave->dcb->remote,
|
||||||
|
ntohs((slave->dcb->ipv4).sin_port),
|
||||||
|
slave->serverid,
|
||||||
|
slave->binlogfile,
|
||||||
|
read_errmsg);
|
||||||
|
}
|
||||||
|
|
||||||
if (hdr.ok == SLAVE_POS_READ_ERR) {
|
if (hdr.ok == SLAVE_POS_READ_ERR) {
|
||||||
MXS_ERROR("%s Slave %s:%i, server-id %d, binlog '%s', %s",
|
MXS_ERROR("%s Slave %s:%i, server-id %d, binlog '%s', %s",
|
||||||
router->service->name,
|
router->service->name,
|
||||||
@ -2166,12 +2176,17 @@ char read_errmsg[BINLOG_ERROR_MSG_LEN+1];
|
|||||||
* but the new binlog file has not yet been created. Therefore
|
* but the new binlog file has not yet been created. Therefore
|
||||||
* we ignore these issues during the rotate processing.
|
* we ignore these issues during the rotate processing.
|
||||||
*/
|
*/
|
||||||
MXS_ERROR("Slave reached end of file for binlog file %s at %lu "
|
MXS_ERROR("%s: Slave %s:%d, server-id %d reached end of file for binlog file %s "
|
||||||
"which is not the file currently being downloaded. "
|
"at %lu which is not the file currently being downloaded. "
|
||||||
"Master binlog is %s, %lu. This may be caused by a "
|
"Master binlog is %s, %lu. This may be caused by a "
|
||||||
"previous failure of the master.",
|
"previous failure of the master.",
|
||||||
|
router->service->name,
|
||||||
|
slave->dcb->remote,
|
||||||
|
ntohs((slave->dcb->ipv4).sin_port),
|
||||||
|
slave->serverid,
|
||||||
slave->binlogfile, (unsigned long)slave->binlog_pos,
|
slave->binlogfile, (unsigned long)slave->binlog_pos,
|
||||||
router->binlog_name, router->binlog_position);
|
router->binlog_name, router->binlog_position);
|
||||||
|
|
||||||
if (blr_slave_fake_rotate(router, slave))
|
if (blr_slave_fake_rotate(router, slave))
|
||||||
{
|
{
|
||||||
spinlock_acquire(&slave->catch_lock);
|
spinlock_acquire(&slave->catch_lock);
|
||||||
|
Reference in New Issue
Block a user