走进官方手册系列 --- 关于LSN的研究(更新中)

本文介绍了MySQL中InnoDB存储引擎使用的日志序列号(LSN)概念及其重要性。LSN是一种用于标识时间点的递增数值,与重做日志记录中的操作相对应,无论这些操作是否处于事务边界内。它被InnoDB内部用于崩溃恢复及缓冲池管理,并且随着日志文件大小限制从4GB增加到512GB,在MySQL 5.6.3版本中,LSN也从4字节扩展到了8字节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_lsn

https://www.devarticles.com/c/a/MySQL/How-Logs-Work-On-MySQL-With-InnoDB-Tables/

http://happytest.blog.51cto.com/324097/62848

http://blog.youkuaiyun.com/yunhua_lee/article/details/6567869

 

LSN
Acronym for “log sequence number”. This arbitrary, ever-increasing value represents a point in time corresponding to operations recorded in the redo log. (This point in time is regardless of transaction boundaries; it can fall in the middle of one or more transactions.) It is used internally by InnoDB during crash recovery and for managing the buffer pool.


Prior to MySQL 5.6.3, the LSN was a 4-byte unsigned integer. The LSN became an 8-byte unsigned integer in MySQL 5.6.3 when the redo log file size limit increased from 4GB to 512GB, as additional bytes were required to store extra size information. Applications built on MySQL 5.6.3 or later that use LSN values should use 64-bit rather than 32-bit variables to store and compare LSN values.


In the MySQL Enterprise Backup product, you can specify an LSN to represent the point in time from which to take an incremental backup. The relevant LSN is displayed by the output of the mysqlbackup command. Once you have the LSN corresponding to the time of a full backup, you can specify that value to take a subsequent incremental backup, whose output contains another LSN for the next incremental backup.


See Also buffer pool, crash recovery, incremental backup, MySQL Enterprise Backup, redo log, transaction.
 

何登成博士画的一张log block的结构图

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值