Skip to content
  • Sujatha Sivakumar's avatar
    970e96b5
    Bug#25076007: SERVER CRASHES IF BINARY LOG IS ROTATED AND · 970e96b5
    Sujatha Sivakumar authored
    DISK-FULL CONDITION OCCURS
    
    Description:
    ============
    Master Server crashes if binary log is rotated and disk-full
    condition occurs on binlog stored partition.
    
    Analysis:
    =========
    In Master Slave setup when slave requests for data from the
    master, a dump thread is created and the dump tread
    initially checks for the existence of binary log. If the
    binary log is enabled it continuously reads data from the
    binary log and sends it to slave.
    
    If due to some critical error, as mentioned in bug scenario,
    rotation of binary log fails due to disk-full scenario then
    the action specified in binlog_error_action is taken.  If
    users choose to ignore the error, then the binary log will
    be disabled.Both the binary log file/index file are closed.
    
    Their corresponding IO_CACHEs are cleared. The server will
    continue to do its work without writing transactions into
    the binary log. In such case dump thread will get EOF on
    current binary log and it will try to move to next binary
    log. At this point dump thread assumes that binary log is
    still active and tries to read the next binary log file name
    from index file IO_CACHE.  Since the IO_CACHE is in cleared
    state it causes server to exit abnormally.
    
    
    Fix:
    ===
    Added a check for the existence of binary log when dump
    thread is switching to next binary log. If binary log is in
    disabled state, all binary logs up to the current active log
    are transmitted to slave and an error is returned to the
    receiver thread.
    
    During testing valgrind issues were found in open_binlog
    code. At the time of disabling binary log only the IO_CACHE
    of binary log index file is cleared without closing the
    actual binary log index file. This results in memory leak.
    Replaced individual cleanup steps with appropriate cleanup
    function call.
    970e96b5
    Bug#25076007: SERVER CRASHES IF BINARY LOG IS ROTATED AND
    Sujatha Sivakumar authored
    DISK-FULL CONDITION OCCURS
    
    Description:
    ============
    Master Server crashes if binary log is rotated and disk-full
    condition occurs on binlog stored partition.
    
    Analysis:
    =========
    In Master Slave setup when slave requests for data from the
    master, a dump thread is created and the dump tread
    initially checks for the existence of binary log. If the
    binary log is enabled it continuously reads data from the
    binary log and sends it to slave.
    
    If due to some critical error, as mentioned in bug scenario,
    rotation of binary log fails due to disk-full scenario then
    the action specified in binlog_error_action is taken.  If
    users choose to ignore the error, then the binary log will
    be disabled.Both the binary log file/index file are closed.
    
    Their corresponding IO_CACHEs are cleared. The server will
    continue to do its work without writing transactions into
    the binary log. In such case dump thread will get EOF on
    current binary log and it will try to move to next binary
    log. At this point dump thread assumes that binary log is
    still active and tries to read the next binary log file name
    from index file IO_CACHE.  Since the IO_CACHE is in cleared
    state it causes server to exit abnormally.
    
    
    Fix:
    ===
    Added a check for the existence of binary log when dump
    thread is switching to next binary log. If binary log is in
    disabled state, all binary logs up to the current active log
    are transmitted to slave and an error is returned to the
    receiver thread.
    
    During testing valgrind issues were found in open_binlog
    code. At the time of disabling binary log only the IO_CACHE
    of binary log index file is cleared without closing the
    actual binary log index file. This results in memory leak.
    Replaced individual cleanup steps with appropriate cleanup
    function call.
Loading