feat(httpapi): harden control plane and speed up prefix refresh

Очередь job получила lease и fencing, телеметрия и прогресс deploy сохраняются, ревизия пишет manifest входов. Обновление префиксов не переписывает неизменённый снимок, большие наборы идут через COPY, а устаревшая ревизия не попадает в deploy. Бандл ноды кэшируется, prune и постановка job больше не держат горячий путь.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
DenozordecandCursor committed 2026-11-02 17:23:59 +07:00
1 parent 924f111e48
commit f8e0520817
197 files changed
+18655 -1416

No files matched your search

@@ -0,0 +1,33 @@
package store
import (
"context"
"errors"
"testing"
)
func TestMemorySnapshotMethodsRespectCancellation(t *testing.T) {
m := NewMemory()
m.SeedDemo()
tenant, _, module, _, _ := m.DemoIDs()
ctx, cancel := context.WithCancel(context.Background())
cancel()
if snap, ok, err := m.GetModulePrefixSnapshot(ctx, tenant, module); snap != nil || ok || !errors.Is(err, context.Canceled) {
t.Fatalf("get: %+v %v %v", snap, ok, err)
}
if err := m.SetModulePrefixSnapshot(ctx, tenant, module, "hash", []PrefixRow{{Prefix: "192.0.2.0/24"}}); !errors.Is(err, context.Canceled) {
t.Fatalf("set: %v", err)
}
if err := m.DeleteModulePrefixSnapshot(ctx, tenant, module); !errors.Is(err, context.Canceled) {
t.Fatalf("delete: %v", err)
}
if err := m.SetModuleInputHash(ctx, tenant, module, "hash"); !errors.Is(err, context.Canceled) {
t.Fatalf("input hash: %v", err)
}
if rows, err := m.ListModuleSnapshotSourceRows(ctx, tenant, module, "ip_range"); rows != nil || !errors.Is(err, context.Canceled) {
t.Fatalf("source rows: %+v %v", rows, err)
}
if snap, ok, err := m.GetModulePrefixSnapshot(context.Background(), tenant, module); snap != nil || ok || err != nil {
t.Fatalf("cancelled write committed: %+v %v %v", snap, ok, err)
}
}