• Kristian Nielsen's avatar
    Revert: MDEV-22351 InnoDB may recover wrong information after RESET MASTER · f8f5ed22
    Kristian Nielsen authored
    This commit can cause the wrong (old) binlog position to be recovered by
    mariabackup --prepare. It implements that the value of the FIL_PAGE_LSN is
    compared to determine which binlog position is the last one and should be
    recoved. However, it is not guaranteed that the FIL_PAGE_LSN order matches the
    commit order, as is assumed by the code. This is because the page LSN could be
    modified by an unrelated update of the page after the commit.
    
    In one example, the recovery first encountered this in trx_rseg_mem_restore():
    
      lsn=27282754  binlog position (./master-bin.000001, 472908)
    
    and then later:
    
      lsn=27282699  binlog position (./master-bin.000001, 477164)
    
    The last one 477164 is the correct position. However, because the LSN
    encountered for the first one is higher, that position is recovered instead.
    This results in too old binlog position, and a newly provisioned slave will
    start replicating too early and get duplicate key error or similar.
    Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
    f8f5ed22
trx0rseg.cc 23 KB