@
keakon > consistent read 一致读
> A read operation that uses snapshot information to present query results based on a point in time, regardless of changes performed by other transactions running at the same time. If queried data has been changed by another transaction, the original data is reconstructed based on the contents of the undo log. This technique avoids some of the locking issues that can reduce concurrency by forcing transactions to wait for other transactions to finish.
> 一种读操作,它使用快照信息基于某个时间点呈现查询结果,而不管同时运行的其他事务执行的更改如何。如果查询的数据被另一个事务更改,则根据 undo log 的内容重建原始数据。此技术通过强制事务等待其他事务完成来避免一些可能降低并发性的锁定问题。
这个重建原始数据的意思,就是找到本事务开始的时候的数据(快照)对吧?所以这一步是通过 MVCC 实现的对吧。
> MVCC
> Acronym for “multiversion concurrency control”. This technique lets InnoDB transactions with certain isolation levels perform consistent read operations; that is, to query rows that are being updated by other transactions, and see the values from before those updates occurred. This is a powerful technique to increase concurrency, by allowing queries to proceed without waiting due to locks held by the other transactions.
也就是说我这个问题的答案就是,MVCC 不仅支持向前回滚查找数据,也支持向后回滚?因为官方文档对 MVCC 的描述是 before those updates occurred ,但没有强调 transaction ID 的先后关系,就是不管哪个事务新哪个事务旧,反正都可以从 undo log 上找到当前这个事务开始的版本,取用?
但是不太懂这个描述的最后一句:强制事务等待其他事务结束,这个和我想问的问题有关系吗?
还是说这个数据快照不是通过 MVCC 实现的?