Document bounded database maintenance jobs

This commit is contained in:
OpenGenesis (MPL 2.0) committed 2026-10-05 20:58:50 +02:00
1 parent 94f770cc44
commit d2e437a91b
1 file changed
+28
+28
View File
@@ -280,6 +280,34 @@ Cross-node migration is deliberately refused unless both simulator nodes adverti
The migration verifies the SHA-256 of the exported OAR and requires the target import to report the identical archive hash. Once a migration starts, normal Job API cancellation is rejected because interruption during the cutover could split authoritative region state between nodes.
## Persistent Job Engine: Database maintenance
OpenGenesisLINK 0.9.3.5 provides bounded maintenance for the authoritative Robust `[DatabaseService]` through job type `database.maintenance`.
`POST /api/v1/jobs/database/maintenance` accepts:
```json
{
"mode": "analyze",
"dry_run": false
}
```
Only the fixed `analyze` mode is accepted. The request cannot contain SQL, table names, connection strings or credentials. The worker detects the configured OpenSim storage provider and supports MySQL/MariaDB through `OpenSim.Data.MySQL.dll`, PostgreSQL through `OpenSim.Data.PGSQL.dll`, and SQLite through `OpenSim.Data.SQLite.dll`. Unsupported providers fail before any maintenance statement is executed.
The worker inventories application tables directly from provider metadata, quotes identifiers derived from that metadata, and executes the provider's native ANALYZE command one table at a time. Jobs are serialized so two database-maintenance runs cannot overlap. Cancellation is cooperative between tables and also requests cancellation of the active provider command. A partial ANALYZE run is safe: already refreshed statistics remain valid and no application rows are rewritten by OpenGenesisLINK.
`dry_run=true` connects to the configured database and inventories the tables but executes no ANALYZE statement. Job results expose only provider name, database name, counts, elapsed time and dry-run state. The configured connection string and secrets are never returned; provider error messages are redacted for password values.
OpenGenesisLINK 0.9.3.5 deliberately does not expose arbitrary SQL, `VACUUM`, `VACUUM FULL`, `OPTIMIZE TABLE`, schema migration, repair or rebuild operations through this API. Those operations can require stronger maintenance-window and backup/rollback guarantees and remain separate operational work.
Configuration:
```ini
[NexVerseWorldApi]
DatabaseMaintenanceCommandTimeoutSeconds = 300
```
## Next API work
The core user lifecycle, persistent audit history, native session revocation, OAuth/OIDC client flows, API keys and request rate limiting are connected.