Internal callback function. This function is used internally by the eXtremeDB backup subsystem to write metadata headers to a backup file. It is passed as a callback during backup operations and should not be called directly by applications.
MCO_RET mco_backup_info(
/*IN*/ mco_uint4 phase,
/*IN*/ const mco_backup_info_t *info,
/*IN*/ void *param
);
phase
MCO_BACKUP_PHASE_1 — initial header write (placeholder),MCO_BACKUP_PHASE_2 — final header update with complete metadata.info
mco_backup_info_t structure containing backup metadata (label, type, database name, etc.).param
mco_backup_ctx_t context structure, cast to void*. Contains the file handle, current
position, CRC, timestamp, and data transfer counter.This internal function writes backup metadata headers to the backup file in two phases:
- Phase 1 (
MCO_BACKUP_PHASE_1): Writes a placeholder header at the beginning of the backup record. Thesizefield is set to zero, marking it as incomplete.- Phase 2 (
MCO_BACKUP_PHASE_2): Seeks back to the placeholder header and updates it with the final size, offset, CRC, timestamp, and magic number once all data chunks have been written.The function ensures that the backup file contains valid, self-describing records that can be parsed during restore or verify operations.
It is invoked automatically by the core backup engine (e.g., from
mco_backup()). Direct use may result in corrupted or unreadable backup files.Applications should use high-level APIs such as
mco_backup_create()instead.See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_DISK_WRITE
MCO_E_DISK_SEEK
MCO_E_ILLEGAL_PARAM
phase value provided.