Internal callback function. This function is used internally by the eXtremeDB restore subsystem to read data chunks from a backup file. It is passed as a callback during restore or verify operations and should not be called directly by applications.
MCO_RET mco_restore_chunk(
/*OUT*/ mco_uint4 *chunk_id,
/*OUT*/ char **pchunk,
/*OUT*/ mco_uint4 *pchunk_size,
/*IN*/ void *param
);
chunk_id
MCO_BACKUP_CHUNK_PAGE_MEMORY,
MCO_BACKUP_CHUNK_DICT, MCO_BACKUP_CHUNK_STOP).pchunk
pchunk_size
param
mco_backup_ctx_t context structure, cast to void*. Contains the backup file handle,
decryption context, CRC state, and I/O buffers.This internal function reads the next data chunk from a backup file during restore or verification. It handles the following tasks:
- Reading compressed and encrypted backup blocks,
- Validating CRC checksums,
- Decrypting and decompressing data on-the-fly,
- Parsing individual chunks from buffered blocks.
The function is designed to be called repeatedly by the core restore engine (e.g., from
mco_restore()) until theMCO_BACKUP_CHUNK_STOPmarker is encountered.It manages internal buffering transparently: when the current block is exhausted, it reads and processes the next block from the file, including decryption and decompression if needed.
Direct use of this function may result in corrupted database state or I/O errors. Applications should use high-level APIs such as
mco_backup_restore()ormco_backup_verify()instead.See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_DISK_READ
MCO_E_DISK_CRC_MISMATCH