• svoj@mysql.com/june.mysql.com's avatar
    BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if · fe3b1c8e
    svoj@mysql.com/june.mysql.com authored
                log-slave-updates and circul repl
    
    Slave SQL thread may execute one extra event when there are events
    skipped by slave I/O thread (e.g. originated by the same server).
    Whereas it was requested not to do so by the UNTIL condition.
    
    This happens because we compare with the end position of previously
    executed event. This is fine when there are no skipped by slave I/O
    thread events, as end position of previous event equals to start
    position of to be executed event. Otherwise this position equals to
    start position of skipped event.
    
    This is fixed by:
    - reading the event to be executed before checking if the until condition
      is satisfied.
    - comparing the start position of the event to be executed. Since we do
      not have the start position available, we compute it by subtracting
      event length from end position (which is available).
    - if there are no events on the event queue at the slave sql starting
      time, that meet until condition, we stop immediately, as in this
      case we do not want to wait for next event.
    fe3b1c8e
rpl_dual_pos_advance.test 2.56 KB