十五:MySQL层事务提交流程简析(笔记)

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: 部分栈帧:2、prepare栈帧(gdb) bt#0 binlog_prepare (hton=0x346f260, thd=0x7fff2c000b70, all=false) at /root/mysql5.

部分栈帧:

2、prepare栈帧

(gdb) bt
#0  binlog_prepare (hton=0x346f260, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:1578
#1  0x0000000000f64e80 in ha_prepare_low (thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2348
#2  0x0000000001856176 in MYSQL_BIN_LOG::prepare (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8165
#3  0x0000000000f63d1f in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1803
#4  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#5  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#6  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#7  0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#8  0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#9  0x00000000016e28f0 in handle_connection (arg=0x384a5d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#10 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848260) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#11 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#12 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) b innobase_trx_init
Breakpoint 7 at 0x19a5fdb: file /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc, line 2753.
(gdb) c
Continuing.

trx_prepare_low

Breakpoint 7, innobase_trx_init (thd=0x7fff2c000b70, trx=0x7ffff2f2db00) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2753
2753            DBUG_ENTER("innobase_trx_init");
(gdb) bt 
#0  innobase_trx_init (thd=0x7fff2c000b70, trx=0x7ffff2f2db00) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2753
#1  0x00000000019a6291 in check_trx_exists (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2816
#2  0x00000000019c2b90 in innobase_xa_prepare (hton=0x2e9cdd0, thd=0x7fff2c000b70, prepare_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:17458
#3  0x0000000000f64e80 in ha_prepare_low (thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2348
#4  0x0000000001856176 in MYSQL_BIN_LOG::prepare (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8165
#5  0x0000000000f63d1f in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1803
#6  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#7  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#8  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#9  0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#10 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#11 0x00000000016e28f0 in handle_connection (arg=0x384a5d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#12 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848260) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#13 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#14 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) 

3、flush 之前写redo 栈帧
1145 bool write_header = new_data_offset == 0;

(gdb) bt
#0  log_group_write_buf (group=0x33ef9f8, buf=0x7fffa5b38000 "\200\020\300\253\002", len=1024, pad_len=0, start_lsn=562123776, new_data_offset=465)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1145
#1  0x0000000001a50dd5 in log_write_up_to (lsn=562124558, flush_to_disk=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1493
#2  0x0000000001a50ec7 in log_buffer_flush_to_disk (sync=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1524
#3  0x00000000019a9077 in innobase_flush_logs (hton=0x2e9cdd0, binlog_group_flush=true)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4407
#4  0x0000000000f65893 in flush_handlerton (thd=0x0, plugin=0x7ffff03588e8, arg=0x7ffff0358944) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2606
#5  0x00000000015d76ee in plugin_foreach_with_mask (thd=0x0, func=0xf65835 <flush_handlerton(THD*, plugin_ref, void*)>, type=1, state_mask=4294967287, 
    arg=0x7ffff0358944) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_plugin.cc:2318
#6  0x0000000000f658ef in ha_flush_logs (db_type=0x0, binlog_group_flush=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2617
#7  0x000000000185725d in MYSQL_BIN_LOG::process_flush_stage_queue (this=0x2dffe80, total_bytes_var=0x7ffff0358a88, rotate_var=0x7ffff0358a87, 
    out_queue_var=0x7ffff0358a78) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8541
#8  0x00000000018588bf in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9189
#9  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#10 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#11 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#12 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#13 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#14 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#15 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#16 0x00000000016e28f0 in handle_connection (arg=0x68e1060) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#17 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848660) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#18 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#19 0x0000003f740e8bcd in clone () from /lib64/libc.so.6

4、order commit innodb层commit栈帧


Breakpoint 2, trx_purge_add_update_undo_to_history (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0purge.cc:332
332             undo = undo_ptr->update_undo;
(gdb) bt
#0  trx_purge_add_update_undo_to_history (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0purge.cc:332
#1  0x0000000001bef543 in trx_undo_update_cleanup (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0undo.cc:1962
#2  0x0000000001bddf57 in trx_write_serialisation_history (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1698
#3  0x0000000001bdf45d in trx_commit_low (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2204
#4  0x0000000001bdf5d2 in trx_commit (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2274
#5  0x0000000001bdff38 in trx_commit_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2550
#6  0x00000000019a9101 in innobase_commit_low (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4451
#7  0x00000000019a99e7 in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4740
#8  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#9  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#10 0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#11 0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#12 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#13 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#14 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#15 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#16 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#17 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#18 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#19 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#20 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#21 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) c
Continuing.

Breakpoint 8, trx_commit_in_memory (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0, serialised=true)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1972
1972            trx->must_flush_log_later = false;
(gdb) bt
#0  trx_commit_in_memory (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0, serialised=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1972
#1  0x0000000001bdf52a in trx_commit_low (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2250
#2  0x0000000001bdf5d2 in trx_commit (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2274
#3  0x0000000001bdff38 in trx_commit_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2550
#4  0x00000000019a9101 in innobase_commit_low (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4451
#5  0x00000000019a99e7 in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4740
#6  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#7  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#8  0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#9  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#10 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#11 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#12 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#13 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#14 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#15 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#16 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#17 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#18 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#19 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) c
Continuing.

Breakpoint 3, trx_commit_complete_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2570
2570            if (trx->id != 0
(gdb) bt
#0  trx_commit_complete_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2570
#1  0x00000000019a9aab in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4762
#2  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#3  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#4  0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#5  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#6  0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#7  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#8  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#9  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#10 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#11 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#12 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#13 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#14 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#15 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
9天前
|
存储 SQL 关系型数据库
MySQL的事务隔离级别
【10月更文挑战第17天】MySQL的事务隔离级别
83 43
|
18天前
|
Java 关系型数据库 MySQL
自动化测试项目实战笔记(一):JDK、Tomcat、MySQL、Jpress环境安装和搭建
这篇文章是关于自动化测试项目实战笔记,涵盖了JDK、Tomcat、MySQL、Jpress环境的安装和搭建过程,以及测试用例和常见问题总结。
33 1
自动化测试项目实战笔记(一):JDK、Tomcat、MySQL、Jpress环境安装和搭建
|
22天前
|
存储 缓存 关系型数据库
MySQL事务日志-Redo Log工作原理分析
事务的隔离性和原子性分别通过锁和事务日志实现,而持久性则依赖于事务日志中的`Redo Log`。在MySQL中,`Redo Log`确保已提交事务的数据能持久保存,即使系统崩溃也能通过重做日志恢复数据。其工作原理是记录数据在内存中的更改,待事务提交时写入磁盘。此外,`Redo Log`采用简单的物理日志格式和高效的顺序IO,确保快速提交。通过不同的落盘策略,可在性能和安全性之间做出权衡。
1585 14
|
14天前
|
SQL 关系型数据库 MySQL
阿里面试:MYSQL 事务ACID,底层原理是什么? 具体是如何实现的?
尼恩,一位40岁的资深架构师,通过其丰富的经验和深厚的技術功底,为众多读者提供了宝贵的面试指导和技术分享。在他的读者交流群中,许多小伙伴获得了来自一线互联网企业的面试机会,并成功应对了诸如事务ACID特性实现、MVCC等相关面试题。尼恩特别整理了这些常见面试题的系统化解答,形成了《MVCC 学习圣经:一次穿透MYSQL MVCC》PDF文档,旨在帮助大家在面试中展示出扎实的技术功底,提高面试成功率。此外,他还编写了《尼恩Java面试宝典》等资料,涵盖了大量面试题和答案,帮助读者全面提升技术面试的表现。这些资料不仅内容详实,而且持续更新,是求职者备战技术面试的宝贵资源。
阿里面试:MYSQL 事务ACID,底层原理是什么? 具体是如何实现的?
|
2月前
|
存储 Oracle 关系型数据库
Oracle和MySQL有哪些区别?从基本特性、技术选型、字段类型、事务、语句等角度详细对比Oracle和MySQL
从基本特性、技术选型、字段类型、事务提交方式、SQL语句、分页方法等方面对比Oracle和MySQL的区别。
329 18
Oracle和MySQL有哪些区别?从基本特性、技术选型、字段类型、事务、语句等角度详细对比Oracle和MySQL
|
2月前
|
SQL 缓存 关系型数据库
揭秘MySQL一条SQL语句的执行流程
以上步骤共同构成了MySQL处理SQL语句的完整流程,理解这一流程有助于更有效地使用MySQL数据库,优化查询性能,及时解决可能出现的性能瓶颈问题。
69 7
|
26天前
|
SQL 关系型数据库 MySQL
【MySQL】索引和事务
【MySQL】索引和事务
45 0
|
2月前
|
SQL Oracle 关系型数据库
详解 MySQL 的事务以及隔离级别
详解 MySQL 的事务以及隔离级别
36 0
|
16天前
|
存储 关系型数据库 MySQL
Mysql(4)—数据库索引
数据库索引是用于提高数据检索效率的数据结构,类似于书籍中的索引。它允许用户快速找到数据,而无需扫描整个表。MySQL中的索引可以显著提升查询速度,使数据库操作更加高效。索引的发展经历了从无索引、简单索引到B-树、哈希索引、位图索引、全文索引等多个阶段。
50 3
Mysql(4)—数据库索引
|
1天前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据需求选择最合适的方法。通过具体案例,展示了编译源码安装的灵活性和定制性。
15 2