mysql没有主键导致延迟_【DB宝34】测试MySQL主从复制中主库表缺失主键会导致主从延迟的情况...

1root@mysql8020M1:/var/lib/mysql# mysqlbinlog mysql8020M1-bin.000008 --base64-output=decode-row -vv | grep UPDATE  | wc -l

240000

3root@mysql8020M1:/var/lib/mysql# mysqlbinlog mysql8020M1-bin.000008 --base64-output=decode-row -vv | more

4/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;

5/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;

6DELIMITER /*!*/;

7# at 4

8#201112 11:25:24 server id 80203318  end_log_pos 125 CRC32 0x11d2d479   Start: binlog v 4, server v 8.0.20 created 201112 11:25:24

9# Warning: this binlog is either in use or was not closed properly.

10# at 125

11#201112 11:25:24 server id 80203318  end_log_pos 196 CRC32 0x443aeae4   Previous-GTIDs

12# dcccf122-1e40-11eb-8ca0-0242c0a844a8:1-240042

13# at 196

14#201112 11:25:33 server id 80203318  end_log_pos 276 CRC32 0xa8eb8112   GTID    last_committed=0        sequence_number=1       rbr_only=yes    original_committed_timestamp=1605151535412817   immediate_commit_timestamp=1605151535412817     transaction_length=2451018

15/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;

16# original_commit_timestamp=1605151535412817 (2020-11-12 11:25:35.412817 CST)

17# immediate_commit_timestamp=1605151535412817 (2020-11-12 11:25:35.412817 CST)

18/*!80001 SET @@session.original_commit_timestamp=1605151535412817*//*!*/;

19/*!80014 SET @@session.original_server_version=80020*//*!*/;

20/*!80014 SET @@session.immediate_server_version=80020*//*!*/;

21SET @@SESSION.GTID_NEXT= 'dcccf122-1e40-11eb-8ca0-0242c0a844a8:240043'/*!*/;

22# at 276

23#201112 11:25:33 server id 80203318  end_log_pos 362 CRC32 0x0b667ff4   Query   thread_id=26    exec_time=0     error_code=0

24SET TIMESTAMP=1605151533/*!*/;

25SET @@session.pseudo_thread_id=26/*!*/;

26SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

27SET @@session.sql_mode=1168113696/*!*/;

28SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;

29

30-- 省略部分  ..................

31#201112 11:25:33 server id 80203318  end_log_pos 2446999 CRC32 0x6e0e09e8       Update_rows: table id 105

32# at 2446999

33#201112 11:25:33 server id 80203318  end_log_pos 2451183 CRC32 0x30bfc23e       Update_rows: table id 105 flags: STMT_END_F

34### UPDATE `lhrdb1`.`t`

35### WHERE

36###   @1=20001 /* INT meta=0 nullable=0 is_null=0 */

37###   @2='主键测试20001' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

38### SET

39###   @1=20001 /* INT meta=0 nullable=0 is_null=0 */

40###   @2='主键测试,结果验证20001' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

41### UPDATE `lhrdb1`.`t`

42### WHERE

43###   @1=20002 /* INT meta=0 nullable=0 is_null=0 */

44###   @2='主键测试20002' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

45### SET

46###   @1=20002 /* INT meta=0 nullable=0 is_null=0 */

47###   @2='主键测试,结果验证20002' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

48

49-- 省略部分  ..................

50

51root@mysql8020M1:/var/lib/mysql# mysqlbinlog mysql8020M1-bin.000008 --base64-output=decode-row -vv | tail -n 20

52###   @1=59999 /* INT meta=0 nullable=0 is_null=0 */

53###   @2='主键测试59999' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

54### SET

55###   @1=59999 /* INT meta=0 nullable=0 is_null=0 */

56###   @2='主键测试,结果验证59999' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

57### UPDATE `lhrdb1`.`t`

58### WHERE

59###   @1=60000 /* INT meta=0 nullable=0 is_null=0 */

60###   @2='主键测试60000' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

61### SET

62###   @1=60000 /* INT meta=0 nullable=0 is_null=0 */

63###   @2='主键测试,结果验证60000' /* VARSTRING(80) meta=80 nullable=0 is_null=0 */

64# at 2451183

65#201112 11:25:33 server id 80203318  end_log_pos 2451214 CRC32 0x3d5db696       Xid = 720239

66COMMIT/*!*/;

67SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;

68DELIMITER ;

69# End of log file

70/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

71/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值