mco_async_restore_stop

Stop the asynchronous restore process.

For an overview see page Incremental Online Backup in C

Prototype

    MCO_RET mco_async_restore_stop(
        /*IN*/ mco_db_h connection,
        /*IN*/ int force
    );

Arguments

connection
Database connection handle associated with the active restore operation.
force
Flag to control shutdown behavior:
  • 0 — allow the restore to complete the current operation before stopping (graceful shutdown),
  • non-zero — terminate the restore immediately (may leave the database in an inconsistent state).

Description

This function terminates the asynchronous restore process associated with the given database connection.

If force is zero, the function waits for the current restore step to complete before stopping. If force is non-zero, the restore thread is terminated immediately, which may leave the database in an unpredictable or inconsistent state.

Use forced termination only in exceptional circumstances (e.g., system shutdown or critical error).

See Incremental Backup and Restore for more details.

Return Codes

MCO_S_OK
Restore process successfully stopped.
MCO_E_BACKUP
No active restore operation was found for the specified connection.

Example

    {
        const char *db_name = "myDb";
        mco_db_h con;
        MCO_RET rc;

        rc = mco_db_connect(db_name, &con);
        if (rc != MCO_S_OK) {
            /* handle connection error */
        }

        /* Gracefully stop the restore process */
        rc = mco_async_restore_stop(con, 0);
        if (rc != MCO_S_OK) {
            /* handle stop error (e.g., no active restore) */
        }
    }

Files

Header file:
mco.h
Source file:
mcobackup.c
Library:
libmcobackup.a