File: rpl_autoinc_lock_style.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (46 lines) | stat: -rw-r--r-- 1,952 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###############################################################################
# Bug#22247668 SLAVE IS ~10X SLOWER TO EXECUTE SET OF STATEMENTS COMPARED TO
#               MASTER RBR
# Problem: A new style of locking is implemented in Innodb. Starting from 5.6,
#          Innodb uses this new style of locking for all the cases except for the case
#          where for a simple (single/multi) row INSERTs, it fall back to old style
#          locking if another transaction has already acquired the AUTOINC lock on behalf of
#          a LOAD FILE or INSERT...SELECT etc. type of statement. But on
#          Slave, in RBR format, it is always using old style auto inc
#          algorithm.
#
# Steps to reproduce:
#  1)  Setup DEBUG simulation point on Slave to bring the server down
#      if the INSERT enters old style autoinc locking method.
#
#  2)  Execute AUTOINC related work on Master.
#
#  3)  Make sure that sync on slave happens without any issues.
#
###############################################################################
--source include/have_debug.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

# Initial setup
CREATE TABLE t (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
--source include/sync_slave_sql_with_master.inc

# Step-1 : Setup DEBUG simulation point on Slave to bring the server down
# if the INSERT enters old style autoinc locking method.
SET @save_debug=@@debug;
SET GLOBAL DEBUG='+d,die_if_autoinc_old_lock_style_used';

# Step-2 :Execute AUTOINC related work on Master.
--source include/rpl_connection_master.inc
INSERT INTO t VALUES (1);
DROP TABLE t;

# Step-3: Due to above DEBUG simulation point, server will go down if it enters
# old autoinc lock style. After fix, sync on Slave happens without any issues.
--source include/sync_slave_sql_with_master.inc

# Cleanup
# Reset the simulation point on Slave.
SET GLOBAL DEBUG=@save_debug;
--source include/rpl_end.inc