Restoration can rewind local evidence
The external service does not rewind with your database. A restored action may appear undispatched even though it was accepted later in production. A safe drill separates data readability from authorization to resume external side effects.
What to do next
- 01
Fence the restored environment
Disable scheduled workers, queue consumers, notifications and outbound generation in the restore target before starting application processes. Use explicit environment controls rather than relying on operators to remember not to click a button.
- 02
Verify the recovered dataset
Check referential integrity, action snapshots, task identities and asset references. Compare the backup timestamp with later audit evidence and identify actions whose remote outcomes may be newer than the restored database.
- 03
Reconcile before resuming
Use preserved external identities and later operational records to resolve the gap. Only resume dispatch after classifying pending actions, with a documented operator decision for any action whose acceptance history cannot be established.
A concrete example
Illustrative example: a 10:00 backup is restored at noon. An action accepted remotely at 10:05 appears pending in the backup. The drill keeps dispatch off until later evidence associates it with the existing job rather than submitting it again.
Run the local counterexample
Local runtime fixture, executed November 16, 2026. No AISwapLab request, payment or model generation was made.
Recorded runtime: Python 3.12.10; SQLite 3.49.1. Run the complete script below using that runtime or record the version and changed behavior in your own environment. The script uses synthetic data and temporary resources only.
import sqlite3,json
source=sqlite3.connect(':memory:');restored=sqlite3.connect(':memory:')
source.execute('CREATE TABLE task(id TEXT PRIMARY KEY,state TEXT)')
source.execute("INSERT INTO task VALUES('A','pending')");source.commit()
source.backup(restored)
source.execute("UPDATE task SET state='completed' WHERE id='A'");source.commit()
restored.execute('PRAGMA query_only=ON')
try:
restored.execute("UPDATE task SET state='dispatching' WHERE id='A'")
writeResult='unexpectedly written'
except sqlite3.OperationalError as e:writeResult=type(e).__name__+': '+str(e)
print(json.dumps({'sourceState':source.execute('SELECT state FROM task').fetchone()[0],
'restoredState':restored.execute('SELECT state FROM task').fetchone()[0],
'queryOnly':restored.execute('PRAGMA query_only').fetchone()[0],'writeAttempt':writeResult}))
source.close();restored.close()
Actual output from this run
{
"sourceState": "completed",
"restoredState": "pending",
"queryOnly": 1,
"writeAttempt": "OperationalError: attempt to write a readonly database"
}Use the result within its scope
The restored copy still said pending after the source had become completed. Its query-only connection rejected a write. A restore drill must reconcile that evidence gap before scheduling work. Read-only database access is useful for inspection, but is only one control: it cannot prevent a process from making HTTP calls, starting another connection or sending notifications.
Only in-memory local databases were used. No real backup, production task or external dispatch was touched, and PRAGMA query_only is not an outbound-network fence.
Before you call it ready
- Restore targets cannot dispatch by default.
- Backup time and external evidence are compared.
- Pending work is classified before resumption.
When to stop or choose another method
Stop enabling production dispatch immediately after a point-in-time restore without reconciling external side effects that the restored database may not remember.
