Stop the asynchronous restore process.
MCO_RET mco_async_restore_stop(
/*IN*/ mco_db_h connection,
/*IN*/ int force
);
connection
force
0 — allow the restore to complete the current operation before stopping (graceful shutdown),This function terminates the asynchronous restore process associated with the given database connection.
If
forceis zero, the function waits for the current restore step to complete before stopping. Ifforceis 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.
MCO_S_OK
MCO_E_BACKUP
{
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) */
}
}