hub v0.136.0: nightly VACUUM INTO snapshot, keep 2 (R-173 decision A); hub PVC 2Gi + Longhorn default group; 09 rulings 125-127; 05 §16.3
gates / gates (push) Failing after 14m0s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-10-05 14:28:30 +02:00
parent 0826e41b31
commit d4be9f6ff1
11 changed files with 544 additions and 3 deletions
+17
View File
@@ -0,0 +1,17 @@
package store
import (
"context"
"fmt"
)
// SnapshotInto writes a consistent, compacted copy of the whole database to path with SQLite's `VACUUM INTO`
// (R-173, hub v0.136.0). One statement inside one read transaction: it sees one point in time and includes every
// committed write still sitting in hub.db-wal — unlike copying hub.db (+ -wal) as files while the hub writes. The
// target must not exist. Pinned by internal/dbsnap (TestSnapshot_*).
func (s *Store) SnapshotInto(ctx context.Context, path string) error {
if _, err := s.db.ExecContext(ctx, `VACUUM INTO ?`, path); err != nil {
return fmt.Errorf("store: VACUUM INTO %s: %w", path, err)
}
return nil
}