You are mixing up two things: «binlogs» and «relaylogs»
The Master writes to a sequence of binlogs on the Master. These are purged by any of () expire_logs_days, () explicit PURGE, (*) OS delete command (not recommended, but possible).
The Slave receives data from the Master’s binlogs and immediately writes the data to a sequence of «relay logs» that live on the Slave. The «IO Thread» does that. Meanwhile, the «SQL thread» is reading the relaylogs and performing the actions. As it finishes a relaylog, it automatically deletes the file. No manual action should ever be needed on the relay logs.
What you did was to try a binlog action on the relaylogs. Don’t do that.
Normally, there will be one, occasionally two, relay logs visible on the Slave. Since you are seeing dozens, the Slave must be terribly far behind on replication. This probably means that it is stuck. Perform SHOW SLAVE STATUS;
to see why. After fixing the problem, the relay logs will cleanup (as mentioned above).
If you do manage to remove/purge/whatever those relay logs, you will permanently break replication. You will have to rebuild the Slave from scratch. So, do not delete those files. (Unless you are rebuilding the Slave, at which point they are ancient history.)
But it is the Master??
- Is it a «Dual-Master» setup? That is when each of two servers is both Master and Slave to each other.
- Or it used to be a Slave, and these logs were not cleaned out?
- Hmmm… all the logs seem to be «empty» (299 bytes), as if something was mis-configured? Such as…
- Dual-Master with the same
server_id
gets the servers into a messy loop.
What’s in one of those relaylogs?
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
Permalink
Cannot retrieve contributors at this time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include/master-slave.inc | |
[connection master] | |
stop slave; | |
SET @@debug_dbug=»d,simulate_find_log_pos_error»; | |
reset slave; | |
ERROR HY000: Target log not found in binlog index | |
show warnings; | |
Level Code Message | |
Error 1373 Target log not found in binlog index | |
Error 1371 Failed purging old relay logs: Failed during log reset | |
SET @@debug_dbug=»»; | |
reset slave; | |
change master to master_host=’dummy’; | |
SET @@debug_dbug=»d,simulate_find_log_pos_error»; | |
change master to master_host=’dummy’; | |
ERROR HY000: Target log not found in binlog index | |
SET @@debug_dbug=»»; | |
reset slave; | |
change master to master_host=’dummy’; | |
SET @@debug_dbug=»d,simulate_find_log_pos_error»; | |
reset master; | |
ERROR HY000: Target log not found in binlog index | |
SET @@debug_dbug=»»; | |
reset master; | |
SET @@debug_dbug=»d,simulate_find_log_pos_error»; | |
purge binary logs to ‘master-bin.000001’; | |
ERROR HY000: Target log not found in binlog index | |
SET @@debug_dbug=»»; | |
purge binary logs to ‘master-bin.000001’; | |
==== clean up ==== | |
CHANGE MASTER TO MASTER_HOST = ‘127.0.0.1’; | |
include/rpl_end.inc |
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-dfsg-5.0 (Ubuntu)
|
New |
Undecided |
Unassigned
|
Bug Description
Launching the script to clean binary-logs it returns
ERROR 1373 (HY000) at line 1: Target log not found in binlog index
this is due to a bug in line 49, where «| cut -f 1» should be add at the end of the command executed. The line should look like
filename=`tail -n $KEEP_BINARY_LOGS $tmp | head -n 1 | cut -f 1`
Bug confirmed by other sources.
To post a comment you must log in.
Error: 1350 SQLSTATE: HY000
(ER_VIEW_SELECT_CLAUSE)
Message: View’s SELECT contains a ‘%s’ clause
Error: 1351 SQLSTATE: HY000
(ER_VIEW_SELECT_VARIABLE)
Message: View’s SELECT contains a variable or parameter
Error: 1352 SQLSTATE: HY000
(ER_VIEW_SELECT_TMPTABLE)
Message: View’s SELECT refers to a temporary table ‘%s’
Error: 1353 SQLSTATE: HY000
(ER_VIEW_WRONG_LIST)
Message: View’s SELECT and view’s field list have different column
counts
Error: 1354 SQLSTATE: HY000
(ER_WARN_VIEW_MERGE)
Message: View merge algorithm can’t be used here for now (assumed
undefined algorithm)
Error: 1355 SQLSTATE: HY000
(ER_WARN_VIEW_WITHOUT_KEY)
Message: View being updated does not have complete key of
underlying table in it
Error: 1356 SQLSTATE: HY000
(ER_VIEW_INVALID)
Message: View ‘%s.%s’ references invalid table(s) or column(s) or
function(s) or definer/invoker of view lack rights to use them
Error: 1357 SQLSTATE: HY000
(ER_SP_NO_DROP_SP)
Message: Can’t drop or alter a %s from within another stored
routine
Error: 1358 SQLSTATE: HY000
(ER_SP_GOTO_IN_HNDLR)
Message: GOTO is not allowed in a stored procedure handler
Error: 1359 SQLSTATE: HY000
(ER_TRG_ALREADY_EXISTS)
Message: Trigger already exists
Error: 1360 SQLSTATE: HY000
(ER_TRG_DOES_NOT_EXIST)
Message: Trigger does not exist
Error: 1361 SQLSTATE: HY000
(ER_TRG_ON_VIEW_OR_TEMP_TABLE)
Message: Trigger’s ‘%s’ is view or temporary table
Error: 1362 SQLSTATE: HY000
(ER_TRG_CANT_CHANGE_ROW)
Message: Updating of %s row is not allowed in %strigger
Error: 1363 SQLSTATE: HY000
(ER_TRG_NO_SUCH_ROW_IN_TRG)
Message: There is no %s row in %s trigger
Error: 1364 SQLSTATE: HY000
(ER_NO_DEFAULT_FOR_FIELD)
Message: Field ‘%s’ doesn’t have a default value
Error: 1365 SQLSTATE: 22012
(ER_DIVISION_BY_ZERO)
Message: Division by 0
Error: 1366 SQLSTATE: HY000
(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD)
Message: Incorrect %s value: ‘%s’ for column ‘%s’ at row %ld
Error: 1367 SQLSTATE: 22007
(ER_ILLEGAL_VALUE_FOR_TYPE)
Message: Illegal %s ‘%s’ value found during parsing
Error: 1368 SQLSTATE: HY000
(ER_VIEW_NONUPD_CHECK)
Message: CHECK OPTION on non-updatable view ‘%s.%s’
Error: 1369 SQLSTATE: HY000
(ER_VIEW_CHECK_FAILED)
Message: CHECK OPTION failed ‘%s.%s’
Error: 1370 SQLSTATE: 42000
(ER_PROCACCESS_DENIED_ERROR)
Message: %s command denied to user ‘%s’@’%s’ for routine ‘%s’
Error: 1371 SQLSTATE: HY000
(ER_RELAY_LOG_FAIL)
Message: Failed purging old relay logs: %s
Error: 1372 SQLSTATE: HY000
(ER_PASSWD_LENGTH)
Message: Password hash should be a %d-digit hexadecimal number
Error: 1373 SQLSTATE: HY000
(ER_UNKNOWN_TARGET_BINLOG)
Message: Target log not found in binlog index
Error: 1374 SQLSTATE: HY000
(ER_IO_ERR_LOG_INDEX_READ)
Message: I/O error reading log index file
Error: 1375 SQLSTATE: HY000
(ER_BINLOG_PURGE_PROHIBITED)
Message: Server configuration does not permit binlog purge
Error: 1376 SQLSTATE: HY000
(ER_FSEEK_FAIL)
Message: Failed on fseek()
Error: 1377 SQLSTATE: HY000
(ER_BINLOG_PURGE_FATAL_ERR)
Message: Fatal error during log purge
Error: 1378 SQLSTATE: HY000
(ER_LOG_IN_USE)
Message: A purgeable log is in use, will not purge
Error: 1379 SQLSTATE: HY000
(ER_LOG_PURGE_UNKNOWN_ERR)
Message: Unknown error during log purge
Error: 1380 SQLSTATE: HY000
(ER_RELAY_LOG_INIT)
Message: Failed initializing relay log position: %s
Error: 1381 SQLSTATE: HY000
(ER_NO_BINARY_LOGGING)
Message: You are not using binary logging
Error: 1382 SQLSTATE: HY000
(ER_RESERVED_SYNTAX)
Message: The ‘%s’ syntax is reserved for purposes internal to the
MySQL server
Error: 1383 SQLSTATE: HY000
(ER_WSAS_FAILED)
Message: WSAStartup Failed
Error: 1384 SQLSTATE: HY000
(ER_DIFF_GROUPS_PROC)
Message: Can’t handle procedures with different groups yet
Error: 1385 SQLSTATE: HY000
(ER_NO_GROUP_FOR_PROC)
Message: Select must have a group with this procedure
Error: 1386 SQLSTATE: HY000
(ER_ORDER_WITH_PROC)
Message: Can’t use ORDER clause with this procedure
Error: 1387 SQLSTATE: HY000
(ER_LOGGING_PROHIBIT_CHANGING_OF)
Message: Binary logging and replication forbid changing the global
server %s
Error: 1388 SQLSTATE: HY000
(ER_NO_FILE_MAPPING)
Message: Can’t map file: %s, errno: %d
Error: 1389 SQLSTATE: HY000
(ER_WRONG_MAGIC)
Message: Wrong magic in %s
Error: 1390 SQLSTATE: HY000
(ER_PS_MANY_PARAM)
Message: Prepared statement contains too many placeholders
Error: 1391 SQLSTATE: HY000
(ER_KEY_PART_0)
Message: Key part ‘%s’ length cannot be 0
Error: 1392 SQLSTATE: HY000
(ER_VIEW_CHECKSUM)
Message: View text checksum failed
Error: 1393 SQLSTATE: HY000
(ER_VIEW_MULTIUPDATE)
Message: Can not modify more than one base table through a join
view ‘%s.%s’
Error: 1394 SQLSTATE: HY000
(ER_VIEW_NO_INSERT_FIELD_LIST)
Message: Can not insert into join view ‘%s.%s’ without fields list
Error: 1395 SQLSTATE: HY000
(ER_VIEW_DELETE_MERGE_VIEW)
Message: Can not delete from join view ‘%s.%s’
Error: 1396 SQLSTATE: HY000 (ER_CANNOT_USER) Message: Operation %s failed for %s
How does the MySQL error message look like?
ERROR 1396 (HY000): Operation CREATE USER failed for 'dummy'@'%'
What does the MySQL error message mean?
MySQL had a problem creating or dropping this user.
When does this MySQL error message happen?
Most probably the user exists already (during creation) or does not exist any more (during deletion).
mysql> create user 'dummy'@'%' identified by 'Abcdrs!12'; Query OK, 0 rows affected (0.00 sec) mysql> -- minutes later mysql> CREATE USER 'dummy'@'%' identified by 'Abcdrs!12'; ERROR 1396 (HY000): Operation CREATE USER failed for 'dummy'@'%' mysql> DROP USER dummy; ERROR 1396 (HY000): Operation DROP USER failed for 'dummy'@'%'
How to fix this MySQL error?
Drop the user before creating it or omit creation. Create user before dropping it or omit dropping.
Error: 1397 SQLSTATE: XAE04
(ER_XAER_NOTA)
Message: XAER_NOTA: Unknown XID
Error: 1398 SQLSTATE: XAE05
(ER_XAER_INVAL)
Message: XAER_INVAL: Invalid arguments (or unsupported command)
Error: 1399 SQLSTATE: XAE07
(ER_XAER_RMFAIL)
Message: XAER_RMFAIL: The command cannot be executed when global
transaction is in the %s state