• Vladislav Vaintroub's avatar
    MDEV-27754 : Assertion with innodb_flush_method=O_DSYNC · 881918bf
    Vladislav Vaintroub authored
    If innodb_flush_method=O_DSYNC, log_sys.flushed_to_disk_lsn  is changed
    without 'flush_lock' protection inside log_write().
    
    This leads to a race condition, if there are 2 threads running in parallel,
    doing log_write_up_to() with different values for 'flush_to_disk'
    
    In this case, log_write() and log_write_flush_to_disk_low() can execute at
    the same time, and both would change flushed_lsn.
    
    The fix is to remove special treatment of durable writes from log_write().
    There is no apparent reason for this special treatment, log_write_flush_to_disk_low()
    is already optimized for durable writes.
    
    Nor there is an apparent reason to call log_flush_notify() more often in
    for O_DSYNC.
    881918bf
log0log.cc 37.2 KB