What is the implementation of Mvcc in Mysql? How to ensure that the records committed by the transaction cannot be read at the RR level?

according to the high-performance Mysql, each row of records in mysql will save a transaction version number at the time of creation and a transaction version number at the time of deletion, and look for records whose creation version number is earlier than the current transaction version number, and delete records whose version number is empty, or delete records whose version number is greater than the current transaction version number.

so, how does it display in this case?
transaction A transaction version number 1

begin            
     select                    B    2
                                  begin
        insert                        
                                       select                          
                    

can transaction B get the insert of transaction A? According to the statement in the high-performance mysql, when insert, the newly inserted row holds the current transaction version number, then insert is the version number of the transaction that the 1Selector query is less than 2, which should be able to be queried. But in that case, does multi-version control acquisition still have illusion? How to isolate phantom reading? Is it beyond the control of MVCC? Or is there some other mechanism to control innodb in RR mode to ensure that phantom reading does not occur?

Nov.12,2021

Yes, and next key
https://codeshelper.com/a/11.


RR isolation level is not fully guaranteed to avoid phantom reading

.
Menu