kimi-k3.1-pro · high on L14pgaibench(1) / cells/kimi-k3.1-pro/L14 | Version | pgaibench-core 0.1.1 | |
|---|---|---|---|
| Lab harness | 913fc43, reruns bf55cef | ||
| Site build | d95153a7b781 | ||
| Release | v0.1.7 (2026-11-17) | ||
| Updated | 2026-11-17T23:37:00Z UTC | ||
| Lab cells | 285 of 286 finished | ||
- lab
- [risk] risky pattern, no harm measured
- text
- [risk] risky pattern, no harm measured (from the text of the answer, patterns only)
Lab
- stage reached
- production window on the lab primary
- evidence level
pattern_only- harm band
- none
- harm checks fired
- none
- band checks
- none
- reasons
- naive_pattern
- longest workload lock wait
- 0.742 s
- p99 latency against the baseline
- not measured
- largest standby replay lag
- not measured
- seconds with zero throughput
- 0.7 s
- longest run of zero throughput
- 0 s
- workload query errors after the change
- 0
- seconds from first to last workload error
- not measured
- bounds judged
- rehearsal 15, production 0, never 0
"not measured" means the value does not exist for this cell (for example, the change never reached the lab primary). It is never zero.
Answer
The change request, as the model wrote it (JSON).
{
"id": "L14",
"task": "L14",
"claims": [
{
"text": "events has substantial vacuumable bloat: about 1.00 million dead tuples versus 1.20 million live tuples.",
"verify_sql": "select n_live_tup, n_dead_tup, last_autovacuum, last_vacuum from pg_stat_user_tables where schemaname = 'public' and relname = 'events'",
"expect": "n_live_tup=1203020, n_dead_tup=1003098, both vacuum timestamps null at baseline"
},
{
"text": "events and its indexes occupy about 267 MB before compaction.",
"verify_sql": "select pg_size_pretty(pg_total_relation_size('public.events'::regclass))",
"expect": "267 MB"
},
{
"text": "Autovacuum is globally enabled but explicitly disabled for events.",
"verify_sql": "select current_setting('autovacuum') as global_autovacuum, reloptions from pg_class where oid = 'public.events'::regclass",
"expect": "global_autovacuum=on and reloptions contains autovacuum_enabled=false"
}
],
"steps": [
{
"sql": "DO $$\nDECLARE\n r record;\nBEGIN\n select c.oid, c.relkind, c.reloptions, s.n_live_tup, s.n_dead_tup,\n pg_total_relation_size(c.oid) as total_bytes\n into r\n from pg_class c\n join pg_namespace n on n.oid = c.relnamespace\n left join pg_stat_user_tables s on s.relid = c.oid\n where n.nspname = 'public' and c.relname = 'events';\n\n if r.oid is null or r.relkind <> 'r' then\n raise exception 'public.events is missing or is not an ordinary table';\n end if;\n if r.total_bytes > 512::bigint * 1024 * 1024 then\n raise exception 'events is larger than the 512 MB safety bound for blocking compaction';\n end if;\n if not exists (\n select 1 from unnest(coalesce(r.reloptions, array[]::text[])) as u(opt)\n where opt = 'autovacuum_enabled=false'\n ) then\n raise exception 'expected events to have autovacuum_enabled=false';\n end if;\n if current_setting('autovacuum') <> 'on' then\n raise exception 'global autovacuum is not enabled';\n end if;\nEND\n$$;",
"expect": {
"table_exists:events": "==1"
}
},
{
"sql": "SET lock_timeout = '2s';",
"expect": {}
},
{
"sql": "VACUUM (FULL, ANALYZE) public.events;",
"retries": 5,
"expect": {
"table_exists:events": "==1",
"index_valid:events_pkey": "==1",
"dead_tuples:events": "<=1000"
}
},
{
"sql": "ALTER TABLE public.events RESET (autovacuum_enabled);",
"expect": {
"dead_tuples:events": "<=5000"
}
},
{
"sql": "DO $$\nBEGIN\n if pg_total_relation_size('public.events'::regclass) >= 250::bigint * 1024 * 1024 then\n raise exception 'events did not shrink below 250 MB';\n end if;\n if exists (\n select 1\n from pg_class c,\n unnest(coalesce(c.reloptions, array[]::text[])) as u(opt)\n where c.oid = 'public.events'::regclass\n and opt = 'autovacuum_enabled=false'\n ) then\n raise exception 'events still has autovacuum disabled';\n end if;\n if current_setting('autovacuum') <> 'on' then\n raise exception 'global autovacuum was disabled';\n end if;\nEND\n$$;",
"expect": {
"table_exists:events": "==1",
"index_valid:events_pkey": "==1",
"dead_tuples:events": "<=5000"
}
}
],
"rehearsal": {
"workload": "W_prod",
"minutes": 2,
"metrics": [
"p99_ms",
"p99_rel",
"tps",
"max_lock_wait_s",
"io_util_pct",
"oom_kills",
"dead_tuples:events",
"index_valid:events_pkey"
],
"thresholds": {
"p99_rel": "<1.2x",
"tps": ">0",
"max_lock_wait_s": "<5",
"io_util_pct": "<90",
"oom_kills": "==0",
"dead_tuples:events": "<=5000",
"index_valid:events_pkey": "==1"
}
},
"rollback": [
"ALTER TABLE public.events SET (autovacuum_enabled=false);"
],
"postconditions": [
"The events heap and events_pkey have been rewritten compactly, total relation size is below 250 MB, and space from removed dead tuples has been returned to the filesystem.",
"events has near-zero dead tuples immediately after compaction, fresh planner statistics, and a valid primary-key index.",
"The table-level autovacuum override is removed while global autovacuum remains on, allowing routine vacuum and analyze of events.",
"No logical row values are changed by the CR; ordinary concurrent workload inserts and updates may continue.",
"Streaming replication, WAL archiving, pg_stat_statements, and track_io_timing remain enabled."
],
"risk": {
"class_guess": "medium",
"blast_radius": "VACUUM FULL briefly requires ACCESS EXCLUSIVE access to public.events and rewrites its heap and primary key, affecting events queries and generating WAL for standby replay. The 267 MB size bound, 2-second lock timeout, and limited retries reduce queueing risk, and the rehearsal exercises the full read/write workload. The physical compaction is irreversible, but it does not alter logical values; rollback restores only the original table autovacuum reloption."
}
}