国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

MySQL 簡易記錄刪除binary log的接口

2024-07-24 12:32:33
字體:
供稿:網(wǎng)友
        歡迎關(guān)注我的《深入理解MySQL主從原理 32講 》,如下:
 
       ![image.png](https://upload-images.jianshu.io/upload_images/7398834-0ffa3bdc078cddf4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 
一、棧幀
      #0  my_delete (name=0x7ffff0fa0490 "./binlog.000005", MyFlags=0) at /root/softm/percona-server-5.7.22-22/mysys/my_delete.c:25#1  0x000000000186416f in inline_mysql_file_delete (key=2, src_file=0x2293340 "/root/softm/percona-server-5.7.22-22/sql/binlog.cc", src_line=6735,
    name=0x7ffff0fa0490 "./binlog.000005", flags=0) at /root/softm/percona-server-5.7.22-22/include/mysql/psi/mysql_file.h:1331#2  0x0000000001871497 in MYSQL_BIN_LOG::purge_index_entry (this=0x2e39c40, thd=0x7fffa4000b70, decrease_log_space=0x0, need_lock_index=false)
    at /root/softm/percona-server-5.7.22-22/sql/binlog.cc:6735#3  0x0000000001870b35 in MYSQL_BIN_LOG::purge_logs (this=0x2e39c40, to_log=0x7ffff0fa0a80 "./binlog.000007", included=false, need_lock_index=true,
    need_update_threads=true, decrease_log_space=0x0, auto_purge=false) at /root/softm/percona-server-5.7.22-22/sql/binlog.cc:6495#4  0x0000000001868839 in purge_master_logs (thd=0x7fffa4000b70, to_log=0x7fffa4006570 "binlog.000007") at /root/softm/percona-server-5.7.22-22/sql/binlog.cc:3127#5  0x00000000015b7874 in mysql_execute_command (thd=0x7fffa4000b70, first_level=true) at /root/softm/percona-server-5.7.22-22/sql/sql_parse.cc:2989#6  0x00000000015c0362 in mysql_parse (thd=0x7fffa4000b70, parser_state=0x7ffff0fa2600) at /root/softm/percona-server-5.7.22-22/sql/sql_parse.cc:5901#7  0x00000000015b3ef6 in dispatch_command (thd=0x7fffa4000b70, com_data=0x7ffff0fa2d70, command=COM_QUERY)
    at /root/softm/percona-server-5.7.22-22/sql/sql_parse.cc:1490#8  0x00000000015b2c83 in do_command (thd=0x7fffa4000b70) at /root/softm/percona-server-5.7.22-22/sql/sql_parse.cc:1021#9  0x00000000016fb8fc in handle_connection (arg=0x38f2910) at /root/softm/percona-server-5.7.22-22/sql/conn_handler/connection_handler_per_thread.cc:312#10 0x0000000001932112 in pfs_spawn_thread (arg=0x3860a50) at /root/softm/percona-server-5.7.22-22/storage/perfschema/pfs.cc:2190#11 0x00007ffff7bc6aa1 in start_thread () from /lib64/libpthread.so.0#12 0x00007ffff6719bcd in clone () from /lib64/libc.so.6
二、大概過程
整個(gè)刪除過程大概是:
 
先提取需要刪除的binary log 記錄到一個(gè) 臨時(shí)的index文件binlog.~rec~中。
將需要保留的binary log文件存放到一個(gè)叫做binlog.index_crash_safe的文件中。
將原有的binlog.index進(jìn)行刪除,將binlog.index_crash_safe重新命名為binlog.index。
下面是中間時(shí)刻的文件列表。
 
(gdb) p purge_index_file->file
$6 = 61OS中我們可以看到這個(gè)文件描述符為61 -> /root/softm/percona-server-5.7.22-22/mysql-test/var/mysqld.1/data/binlog.~rec~

(編輯:武林網(wǎng))

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 射阳县| 云林县| 丰原市| 肇州县| 武夷山市| 思茅市| 康马县| 乐山市| 长岭县| 崇左市| 茌平县| 桐庐县| 大渡口区| 高淳县| 通江县| 德化县| 林甸县| 湾仔区| 兴安县| 松原市| 犍为县| 太保市| 南开区| 铁力市| 淅川县| 永胜县| 启东市| 揭阳市| 淮滨县| 青海省| 罗田县| 婺源县| 北票市| 永福县| 秀山| 邵东县| 新乐市| 崇仁县| 泉州市| 钟祥市| 玛纳斯县|