[MDEV-9164] during mysqldump , slave start Failed Created: 2015-11-22  Updated: 2020-10-18  Resolved: 2020-10-18

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.0.22
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: sysdljr Assignee: Elena Stepanova
Resolution: Incomplete Votes: 0
Labels: None
Environment:

CentOS 6.6 , MariaDB Server 10.0.22


Attachments: Zip Archive error.zip    

 Description   

Hi, all

At 2:30 am of every day , run mysqldump backup database. at 2:50 , backup completed.
backup shell script :

mysqldump  --single-transaction --dump-slave=2 -R -E -A > /data/backup/db.bak.
Slavesql=$(mysql -u$user -p$pwd -e "show slave status \G" | grep "Slave_SQL_Running" | awk '{print $2}'| head -1)
 
if [ $Slavesql = "No" ]; then
  mysql -u$user -p$pwd -e "start slave sql_thread;"
fi

today , we encounter a problem below( before the problem , both backup and start slave normal )

151122  2:28:24 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.019252' at position 1073741972, relay log '/data/mysql/log/relay-bin.001773' position: 4; GTID position '1-5358-2,0-5358-41013482462'
151122  2:28:24 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table db01.userdata; Duplicate entry 'GT~70086000033071590-111153-2015-11-22' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.019252, end_log_pos 1073742442, Gtid 0-5358-41011850370, Internal MariaDB error code: 1062
151122  2:28:24 [Warning] Slave: Duplicate entry 'GT~70086000033071590-111153-2015-11-22' for key 'PRIMARY' Error_code: 1062
151122  2:28:24 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.019252' position 1073741972; GTID position '1-5358-2,0-5358-41013482462'
151122  2:28:24 [Note] Error reading relay log event: slave SQL thread was killed
151122  2:28:24 [ERROR] Slave (additional info): Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964
151122  2:28:24 [Warning] Slave: Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964

A similar question was raised: MDEV-8405

we temporary solved method: skip_slave_error=1062 , restart mysql



 Comments   
Comment by Elena Stepanova [ 2015-11-23 ]

Sorry, I don't understand – if the backup starts at 02:30, then how an error which occurred at 02:28:24 can be related to it?

Comment by sysdljr [ 2015-11-23 ]

Thank you reply.
Sorry, backup time is 2:10 am.
In addition, we have a shell scrip of check slave sql status, every 30 minutes run once

# when backup or slave abnormal stop, restart slave sql
if [ $Slavesql = "No" ]
then
  mysql -u$user -p$pwd  -e "start slave sql_thread;"
fi

Comment by Elena Stepanova [ 2015-11-23 ]

If backup starts at 2:10, please quote the error log from at least 02:10, or even from the last server startup.
Please also attach your cnf file(s).

Comment by sysdljr [ 2015-11-24 ]

error log and my.cnf error.zip

all tables of occur error are partition table , Write very frequently , about 500/sec

Comment by Elena Stepanova [ 2020-10-18 ]

Closing since 10.0 is no longer supported. If the problem is encountered in recent versions, it can be re-opened.

Generated at Thu Feb 08 07:32:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.