querylog: checkpoint every 8192 wal pages instead of 1000
This commit is contained in:
@@ -600,6 +600,36 @@ test "S7 case 23: a locked querylog propagates Busy and is never destroyed" {
|
||||
try testing.expectEqual(@as(usize, 0), asides_after.items.items.len);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// the querylog checkpoint threshold (specs/querylog-autocheckpoint.md)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
test "every querylog connection carries the raised wal_autocheckpoint; config.db keeps the default" {
|
||||
if (!build_options.integration) return error.SkipZigTest;
|
||||
|
||||
var f: Fixture = .init();
|
||||
defer f.deinit();
|
||||
|
||||
var data = try openMigrated(&f, "data");
|
||||
defer data.deinit();
|
||||
|
||||
var opened = try data.dir.openQuerylogDb(io);
|
||||
defer opened.database.close();
|
||||
try testing.expectEqual(
|
||||
@as(i64, querylog_schema.wal_autocheckpoint_pages),
|
||||
try opened.database.queryInt("PRAGMA wal_autocheckpoint"),
|
||||
);
|
||||
|
||||
var reopened = try data.dir.reopenQuerylogDb(io);
|
||||
defer reopened.close();
|
||||
try testing.expectEqual(
|
||||
@as(i64, querylog_schema.wal_autocheckpoint_pages),
|
||||
try reopened.queryInt("PRAGMA wal_autocheckpoint"),
|
||||
);
|
||||
|
||||
try testing.expectEqual(@as(i64, 1000), try data.database.queryInt("PRAGMA wal_autocheckpoint"));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// case 8-10: config.db, permissions and the schema stamp
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user