storage: version querylog.db and migrate it in place, never reset a healthy file
Gates / frontend (push) Successful in 2m8s
Gates / test (push) Successful in 2m46s
Gates / test-aarch64 (push) Successful in 8m38s
Gates / package (push) Successful in 4m39s
Gates / container (push) Successful in 15s
CI / gates (push) Successful in 31m58s

querylog.db carries a schema version; migrations run at startup as one transaction after a vacuumed 0600 backup, and every failure refuses startup (exit 2, no systemd restart loop) instead of starting empty. corruption is the only automatic recreate left. the cut gate now requires a fixture-proven migration or an explicit versioned break with restore instructions, and locks shipped migration files and fixtures byte-for-byte.
This commit is contained in:
2026-08-28 17:56:19 +02:00
parent c9701fae85
commit 0f01c2fbd7
25 changed files with 4312 additions and 176 deletions
+4 -1
View File
@@ -2518,7 +2518,10 @@ const recompute_checks = [_]struct { projection: []const u8, recompute: []const
},
};
fn expectProjectionsMatchRecompute(database: *db.Db) !void {
/// Exported for `querylog_migrations.zig`'s fixture and migration tests: the
/// authority on projection coherence is this file, and a second copy of the
/// recompute SQL there would be free to drift from the writer it checks.
pub fn expectProjectionsMatchRecompute(database: *db.Db) !void {
for (recompute_checks) |check| {
var buf: [4096]u8 = undefined;
const sql = try std.fmt.bufPrint(