The role of MySQL transaction-redo log

One, redo log

  1. Memory page

  

  2. CSR automatic failure recovery

    1) Write the content that the user needs to modify into the memory, and generate LSN=1

    2) The memory generates a redo_log buffer area at the same time, records the modification process, and generates LSN=2

    3) Submit and write to disk

    4) If the memory is lost, load the original data at the same time, load redo_logfile into the memory, redo redo_log, make the data consistent with the LSN in redo_log, and start mysql

  

   3. Undo log

    1) When the user modifies the data, an undo (snapshot) is also generated

    2) If the user continues to submit, undo will automatically become invalid. If you choose to roll back, use the undo log to restore the data, and LSN will generate a new one

Two, isolation level

  1 Overview

  

   2. View

  

   3. Modify

  

   

   

   4. Lock

  

  example:

  

        HUAWEI CLOUD servers start the new year purchasing season in March, and new users will get a 20% discount, and there will be a chance to use it for free from January to February!

         Web link

       

Guess you like

Origin blog.csdn.net/qq_33648367/article/details/113103557