• Marko Mäkelä's avatar
    Follow-up fix to MDEV-12988 backup fails if innodb_undo_tablespaces>0 · e9e051d2
    Marko Mäkelä authored
    The fix broke mariabackup --prepare --incremental.
    
    The restore of an incremental backup starts up (parts of) InnoDB twice.
    First, all data files are discovered for applying .delta files. Then,
    after the .delta files have been applied, InnoDB will be restarted
    more completely, so that the redo log records will be applied via the
    buffer pool.
    
    During the first startup, the buffer pool is not initialized, and thus
    trx_rseg_get_n_undo_tablespaces() must not be invoked. The apply of
    the .delta files will currently assume that the --innodb-undo-tablespaces
    option correctly specifies the number of undo tablespace files, just
    like --backup does.
    
    The second InnoDB startup of --prepare for applying the redo log will
    properly invoke trx_rseg_get_n_undo_tablespaces().
    
    enum srv_operation_mode: Add SRV_OPERATION_RESTORE_DELTA for
    distinguishing the apply of .delta files from SRV_OPERATION_RESTORE.
    
    srv_undo_tablespaces_init(): In mariabackup --prepare --incremental,
    in the initial SRV_OPERATION_RESTORE_DELTA phase, do not invoke
    trx_rseg_get_n_undo_tablespaces() because the buffer pool or the
    redo logs are not available. Instead, blindly rely on the parameter
    --innodb-undo-tablespaces.
    e9e051d2
fil_cur.cc 10.6 KB