Skip to content
  • Kapil Agrawal's avatar
    79b20a3a
    Bug#29848785 REPLICATION OF MEMORY TABLES · 79b20a3a
    Kapil Agrawal authored
    Problem
    -------
    In case of MEMORY TABLES, the table content is deleted after every server
    restart and to make sure that both master-slave are in sync we log an
    implicit DELETE statement in the binary log of the server which just has
    restarted.
    
    There are some issues with the above implementation :
    
    I1. DELETE statement is always be written in statement format even if the
        binlog format is ROW.
    I2. DELETE statement is always written to the binary log even if
        (super_)read_only is set to 1.
    
    Fix
    ---
    
    1. To fix I1 we are changing DELETE to TRUNCATE because it is clearly
       mentioned in MYSQL documentation that truncate statement is always written
       in statement format in the binary log.
    
    2. We do not address issue I2, We argue that the violation of read_only
       mode happened already when the table data was erased. The write to the
       binary log is only reflecting that. It should not be expected that
       MEMORY tables obey the rules of read_only. If this induces problems for
       any user, the user should disable the MEMORY engine.
    
    RB#24592
    79b20a3a
    Bug#29848785 REPLICATION OF MEMORY TABLES
    Kapil Agrawal authored
    Problem
    -------
    In case of MEMORY TABLES, the table content is deleted after every server
    restart and to make sure that both master-slave are in sync we log an
    implicit DELETE statement in the binary log of the server which just has
    restarted.
    
    There are some issues with the above implementation :
    
    I1. DELETE statement is always be written in statement format even if the
        binlog format is ROW.
    I2. DELETE statement is always written to the binary log even if
        (super_)read_only is set to 1.
    
    Fix
    ---
    
    1. To fix I1 we are changing DELETE to TRUNCATE because it is clearly
       mentioned in MYSQL documentation that truncate statement is always written
       in statement format in the binary log.
    
    2. We do not address issue I2, We argue that the violation of read_only
       mode happened already when the table data was erased. The write to the
       binary log is only reflecting that. It should not be expected that
       MEMORY tables obey the rules of read_only. If this induces problems for
       any user, the user should disable the MEMORY engine.
    
    RB#24592
Loading