control-api: reduce SQLite disk writes; add diagnostic mode
Disk writes: - SQLite pragmas in DSN: wal_autocheckpoint=10000, journal_size_limit=64MB, cache_size=64MB - migration 0013: drop redundant idx_checks_registry_cycle - results batched: UpsertChecksIfOpen in one transaction; agent flushes every 5s and before complete - heartbeat kept in memory, persisted on state change or every 60s; startup grace for stale sweeps Diagnostic mode: - POST /api/v1/admin/diagnostics/attach|detach, GET /api/v1/admin/diagnostics - migration 0014: diagnostic_holds; validator state "diagnostic" - held addresses are not queued, held validators skip sweeps, port release and delete Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d0ab6b94f9
commit
55d383bd34
41 files changed
+1214
-94
No files matched your search
@@ -86,7 +86,9 @@ func (d *DB) ClaimNextQueued(ctx context.Context, validatorID string, leaseTTL t
|
||||
var item IPQueueItem
|
||||
err = tx.QueryRowContext(ctx, `
|
||||
SELECT q.id, q.ip_address, q.sequence, q.attempt_number, q.retry_count
|
||||
FROM ip_queue q WHERE q.state=? AND NOT EXISTS (
|
||||
FROM ip_queue q WHERE q.state=?
|
||||
AND NOT EXISTS (SELECT 1 FROM diagnostic_holds h WHERE h.address=q.ip_address)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM ip_self_check_failures f
|
||||
WHERE f.registry_id=q.registry_id AND f.validator_id=? AND f.cycle_id>=q.sc_round_start_cycle)
|
||||
ORDER BY q.sequence LIMIT 1
|
||||
|
||||
Reference in new issue
Block a user