Internal function. This is a low-level runtime routine used by the eXtremeDB backup subsystem to restore database state from backup chunks or verify backup integrity. It is invoked internally by
mco_backup_restore()andmco_backup_verify()and should not be called directly by applications.
MCO_RET mco_restore(
/*IN*/ mco_db_h connection,
/*IN*/ const mco_backup_info_t *backup_info,
/*IN*/ mco_restore_chunk_proc_t proc_chunk,
/*IN*/ void *proc_arg
);
connection
backup_info
mco_backup_info_t structure containing metadata of the backup record being processed (e.g., page sizes, transaction number, protocol version).proc_chunk
NULL.proc_arg
proc_chunk callback.This internal function implements the core logic for restoring a database from a sequence of backup chunks or validating their integrity. It is called during both restore (
do_restore = 1) and verify (do_restore = 0) operations initiated bymco_backup_restore()andmco_backup_verify(), respectively.The function:
- Validates compatibility between the backup metadata and the current database configuration (page sizes, memory layout, etc.),
- Locks the database exclusively during restoration,
- Iteratively processes backup chunks (pages, dictionary, indexes, transaction logs, etc.) via the
proc_chunkcallback,- Reconstructs the database state in memory and on disk,
- Updates internal backup flags upon successful snapshot restoration.
Direct use of this function may lead to database corruption or undefined behavior. Applications should use the public API functions
mco_backup_restore()andmco_backup_verify()instead.See Incremental Backup and Restore in C for usage examples.
MCO_S_OK
MCO_E_ILLEGAL_PARAM
NULL connection, missing callbacks, or invalid backup_info).MCO_E_BACKUP_INVALID_PARAM
MCO_DB_INCREMENTAL_BACKUP_ENABLED flag missing).MCO_E_BACKUP_PROTOCOL