Skip to content
  • Joao Gramacho's avatar
    44d2a00d
    Bug#23054591 PURGE BINARY LOGS TO IS READING THE WHOLE BINLOG FILE AND · 44d2a00d
    Joao Gramacho authored
                 CAUSING MYSQL TO STALL
    
    Problem:
    
    When GTID_MODE=OFF, calling "PURGE BINARY LOGS TO '<FILE>'" causes the
    system to read the whole '<FILE>' file. When the referenced file is
    big, this may stall the server for a few seconds.
    
    Analysis:
    
    The server needs to read the Previous_gtids of the first binary log
    file kept after the purge in order to compute the GTID_PURGED.
    
    There is an optimization that stops the reading in the binary log
    file once finding the first GTID event. That's why the issue is
    only happening when GTID_MODE=OFF.
    
    Fix:
    
    Added an optimization to stop reading the binary log file when
    it is supposed to read only the "lost" GTIDs and a PREVIOUS_GTIDS
    event is found. This will cover the default 5.7.7+ behavior because
    of binlog_gtid_simple_recovery option.
    44d2a00d
    Bug#23054591 PURGE BINARY LOGS TO IS READING THE WHOLE BINLOG FILE AND
    Joao Gramacho authored
                 CAUSING MYSQL TO STALL
    
    Problem:
    
    When GTID_MODE=OFF, calling "PURGE BINARY LOGS TO '<FILE>'" causes the
    system to read the whole '<FILE>' file. When the referenced file is
    big, this may stall the server for a few seconds.
    
    Analysis:
    
    The server needs to read the Previous_gtids of the first binary log
    file kept after the purge in order to compute the GTID_PURGED.
    
    There is an optimization that stops the reading in the binary log
    file once finding the first GTID event. That's why the issue is
    only happening when GTID_MODE=OFF.
    
    Fix:
    
    Added an optimization to stop reading the binary log file when
    it is supposed to read only the "lost" GTIDs and a PREVIOUS_GTIDS
    event is found. This will cover the default 5.7.7+ behavior because
    of binlog_gtid_simple_recovery option.
Loading