mirror of
https://github.com/Haidra-Org/AI-Horde.git
synced 2026-11-06 05:17:31 +00:00
- Align speed materialization with runtime behavior by treating an average performance of 0 like no samples and falling back to the worker baseline, preventing downstream division-by-zero on speed reads. - Add an index on worker_performances.worker_id in the model and migration path to avoid repeated full-table scans during backfill and ongoing performance updates. - Refactor 5.0.4 SQL rollout guidance, and add temporary insert-trigger scaffolding for mixed 5.0.3/5.0.4 fleets with a follow-up cleanup script. - Add unit tests covering zero-average fallback and recovery once nonzero samples arrive.
12 lines
466 B
Plaintext
12 lines
466 B
Plaintext
-- Removes the rollout scaffolding added by 5.0.4.txt.
|
|
--
|
|
-- Run only once no 5.0.3 instance remains in the fleet. A 5.0.3 worker registration
|
|
-- omits the speed column, and once this trigger is gone that INSERT fails against the
|
|
-- NOT NULL constraint. Until then the trigger is also what keeps a rollback to 5.0.3
|
|
-- viable.
|
|
|
|
SET lock_timeout = '3s';
|
|
|
|
DROP TRIGGER IF EXISTS workers_speed_baseline_trg ON workers;
|
|
DROP FUNCTION IF EXISTS workers_speed_baseline();
|