四:GTID中的运维(笔记)

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: 一、ONGOING_ANONYMOUS_TRANSACTION_COUNT主库 生成GTID: 这下面可以调用匿名+1(gdb) bt#0 Gtid_state::generate_automatic_gtid (this=0x308ab20, thd=0x7ffe7c000b70, sp...

一、ONGOING_ANONYMOUS_TRANSACTION_COUNT

主库 生成GTID: 这下面可以调用匿名+1

(gdb) bt
#0  Gtid_state::generate_automatic_gtid (this=0x308ab20, thd=0x7ffe7c000b70, specified_sidno=0, specified_gno=0, locked_sidno=0x7fffec0f38c0)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/rpl_gtid_state.cc:507
#1  0x0000000001877a61 in MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group (this=0x2e87840, first_seen=0x7ffe7c000b70)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:1401
#2  0x000000000188a19c in MYSQL_BIN_LOG::process_flush_stage_queue (this=0x2e87840, total_bytes_var=0x7fffec0f3a08, rotate_var=0x7fffec0f3a07, 
    out_queue_var=0x7fffec0f39f8) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9143
#3  0x000000000188b743 in MYSQL_BIN_LOG::ordered_commit (this=0x2e87840, thd=0x7ffe7c000b70, all=false, skip_commit=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9782
#4  0x0000000001889e22 in MYSQL_BIN_LOG::commit (this=0x2e87840, thd=0x7ffe7c000b70, all=false) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9033
#5  0x0000000000f802eb in ha_commit_trans (thd=0x7ffe7c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:1830
#6  0x00000000016dd5b9 in trans_commit_stmt (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/transaction.cc:458
#7  0x00000000015d19d1 in mysql_execute_command (thd=0x7ffe7c000b70, first_level=true) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5293
#8  0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901
#9  0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70, com_data=0x7fffec0f6d70, command=COM_QUERY)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490
#10 0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021
#11 0x000000000170e660 in handle_connection (arg=0x34a9940) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc:312
#12 0x0000000001945620 in pfs_spawn_thread (arg=0x66eee50) at /root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190
#13 0x00007ffff7bc6aa1 in start_thread () from /lib64/libpthread.so.0
#14 0x00007ffff6719bcd in clone () from /lib64/libc.so.6

主库在COMMIT节点 匿名-1

#0  Gtid_state::update_commit_group (this=0x308ab20, first_thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/rpl_gtid_state.cc:148
#1  0x000000000188a59f in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2e87840, thd=0x7ffe7c000b70, first=0x7ffe7c000b70)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9238
#2  0x000000000188bd46 in MYSQL_BIN_LOG::ordered_commit (this=0x2e87840, thd=0x7ffe7c000b70, all=false, skip_commit=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9921
#3  0x0000000001889e22 in MYSQL_BIN_LOG::commit (this=0x2e87840, thd=0x7ffe7c000b70, all=false) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:9033
#4  0x0000000000f802eb in ha_commit_trans (thd=0x7ffe7c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:1830
#5  0x00000000016dd5b9 in trans_commit_stmt (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/transaction.cc:458
#6  0x00000000015d19d1 in mysql_execute_command (thd=0x7ffe7c000b70, first_level=true) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5293
#7  0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901
#8  0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70, com_data=0x7fffec0f6d70, command=COM_QUERY)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490
#9  0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021
#10 0x000000000170e660 in handle_connection (arg=0x34a9940) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc:312
#11 0x0000000001945620 in pfs_spawn_thread (arg=0x66eee50) at /root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190
#12 0x00007ffff7bc6aa1 in start_thread () from /lib64/libpthread.so.0
#13 0x00007ffff6719bcd in clone () from /lib64/libc.so.6

从库 GTID_APPLY的时候 调用
Gtid_log_event::do_apply_event - > set_gtid_next 匿名+1

从库是调用Gtid_state::update_gtids_impl 匿名-1

Xid_log_event::do_commit - >MYSQL_BIN_LOG::gtid_end_transaction -> update_on_commit->update_gtids_impl

二、MASTER_AUTO_POSITION = 1栈帧

清理了所有的replay log

#0  Relay_log_info::purge_relay_logs (this=0x67618a0, thd=0x7ffe7c000b70, just_reset=false, errmsg=0x7fffec0f4b80, delete_only=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/rpl_rli.cc:1239
#1  0x00000000018cd130 in change_master (thd=0x7ffe7c000b70, mi=0x6670230, lex_mi=0x7ffe7c0037e0, preserve_logs=false)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/rpl_slave.cc:11337
#2  0x00000000018cdcac in change_master_cmd (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/rpl_slave.cc:11688
#3  0x00000000015cabc5 in mysql_execute_command (thd=0x7ffe7c000b70, first_level=true) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:3125
#4  0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901
#5  0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70, com_data=0x7fffec0f6d70, command=COM_QUERY)
    at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490
#6  0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021
#7  0x000000000170e660 in handle_connection (arg=0x5f72350) at /root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc:312
#8  0x0000000001945620 in pfs_spawn_thread (arg=0x67cfa60) at /root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190
#9  0x00007ffff7bc6aa1 in start_thread () from /lib64/libpthread.so.0
#10 0x00007ffff6719bcd in clone () from /lib64/libc.so.6
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
1月前
|
存储 运维 安全
2024.3.18隐语训练营第1讲笔记:数据可信流通,从运维信任到技术信任
数据二十条提出了要建立数据可信流通体系,使得数据可以安全的流转起来。但由于在数据流通中存在的各种风险,使得信任四要素全部遭到破坏,导致信任降级甚至崩塌。为了应对这些风险,要实现从运维信任到技术信任的转变,针对信任的各个要素,提出了解决方案。最后简要介绍了安全可信基础设施的融合布局。
44 3
|
3月前
|
缓存 网络协议 数据安全/隐私保护
[运维笔记] - (命令).Windows server常用网络相关命令总结
[运维笔记] - (命令).Windows server常用网络相关命令总结
190 0
|
1月前
|
运维 安全 区块链
隐语训练营第1讲笔记:数据可信流通,从运维信任到技术信任
数据可信流通需要从运维信任转向技术信任,需要安全可信基础设施的融合布局。
41 1
|
1月前
|
存储 运维 安全
[隐私计算实训营笔记]第一课——数据可信流通,从运维信任到技术信任
本课以数据要素可信流通,重构技术信任体系为主题,介绍了信任四要素,以及其对应破环的原因,因此需要从运维信任走向技术信任的路线,并最终完成安全可信基础设施的融合布局。 感谢授课人韦韬老师~
|
1月前
|
运维 安全 数据安全/隐私保护
|
1月前
|
运维 NoSQL Linux
运维排错笔记
运维排错笔记
17 1
|
2月前
|
存储 运维 监控
「笔记」某移动 SRE 运维体系交流
「笔记」某移动 SRE 运维体系交流
|
3月前
|
存储 运维 JavaScript
[运维笔记] PowerShell (模块).模块的查找、安装、卸载、更新、保存、发布
[运维笔记] PowerShell (模块).模块的查找、安装、卸载、更新、保存、发布
90 0
|
3月前
|
运维
[运维笔记] PowerShell (模块).模块清单
[运维笔记] PowerShell (模块).模块清单
28 0
[运维笔记] PowerShell (模块).模块清单