2.1 KiB
Pinned database identity and read-only MySQL backups
Supply a trusted server UUID (MySQL) or system identifier (PostgreSQL) to
DatabaseIdentityProbe. MySQL also requires the exact authenticated
user@host grant account. Obtain the pin and account from a trusted
provisioning inventory. The account's normal DNS address alone is insufficient.
PostgreSQL requires explicit execute access to pg_catalog.pg_control_system()
in the target database. The probe reads the configured database, authenticated
account and server identifier in one query. Use the probe as the runtime check
for inspection or deployment coordination. For backups, bind the probe to
BackupEngine(..., live_identity=probe) using the same adapter and runner.
The engine checks the pin before and after the dump. Existing backup manifests
can still be verified, including older PostgreSQL manifests without a server ID.
For supported MySQL schemas, opt in through
get_adapter(config, mysql_read_only_backup=True). The backup account needs
only SELECT and SHOW VIEW on the site schema and EXECUTE on
absdev_backup_control.check_inventory. The framework validates these exact
direct grants, requires MySQL partial_revokes=ON for literal schema grants, and checks the schema inventory before and after the dump.
Extra grants, unverifiable inventory and unsupported schema objects block
publication. Keep schema-changing operations excluded throughout the dump.
The pre- and post-checks do not provide a database-wide DDL lock.
The DBA-owned control procedure must be outside the application database. Use a locked definer with authority to see the target schema's inventory, constrain it to approved callers and schemas, and return exactly one row with four integer counts in this order:
- Triggers
- Stored routines
- Events
- Non-InnoDB base tables
All four counts must be zero. The read-only profile covers InnoDB tables and views. A site with triggers, routines or events requires separately qualified backup and recovery coverage for those objects. Existing full-dump callers retain their current behavior.
These APIs do not enable a production command or change the production gates.