claude-fable-5.2 · high on R9pgaibench(1) / cells/claude-fable-5.2/R9 | Version | pgaibench-core 0.1.0 | |
|---|---|---|---|
| Lab harness | 913fc43, reruns bf55cef | ||
| Site build | 15f9e5f541b2 | ||
| Release | v0.1.0 (2026-11-11) | ||
| Updated | 2026-11-12T00:04:11Z UTC | ||
| Lab cells | 263 of 264 finished | ||
- lab
- [ok] right change
- text
- [ok] right change (from the text of the answer, patterns only)
Lab
- stage reached
- production window on the lab primary
- evidence level
full- harm band
- none
- harm checks fired
- none
- band checks
- none
- reasons
- rehearsal_skipped_steps, success, safe_pattern
- longest workload lock wait
- 0 s
- p99 latency against the baseline
- not measured
- largest standby replay lag
- not measured
- seconds with zero throughput
- 0 s
- longest run of zero throughput
- 0 s
- bounds judged
- rehearsal 12, production 1, 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": "CR-R9-shared-buffers-4GB",
"task": "R9",
"claims": [
{
"text": "shared_buffers is currently 2 GB (262144 x 8 kB), is a postmaster-context setting, and has no pending change; raising it needs a restart of each node.",
"verify_sql": "select setting, unit, context, pending_restart from pg_settings where name = 'shared_buffers'",
"expect": "262144, 8kB, postmaster, false"
},
{
"text": "Total shared memory is about 2151 MB today, so about 103 MB on top of the buffer pool; at 4 GB it will be about 4.2-4.3 GB, roughly 27 percent of the 16 GB stated in the task.",
"verify_sql": "select pg_size_pretty(sum(size)) from pg_shmem_allocations",
"expect": "2151 MB before the change; about 4.2-4.3 GB after"
},
{
"text": "No other setting is waiting for a restart, so the restart activates only shared_buffers (enforced in step 1).",
"verify_sql": "select count(*) from pg_settings where pending_restart",
"expect": "0"
},
{
"text": "shared_buffers is not set on the postmaster command line, so ALTER SYSTEM plus restart takes effect (enforced in step 1).",
"verify_sql": "select source from pg_settings where name = 'shared_buffers'",
"expect": "configuration file or default, not 'command line'"
},
{
"text": "huge_pages is not 'on' (or enough huge pages are reserved), so the larger shared memory segment cannot stop the postmaster from starting (enforced in step 1 for the primary).",
"verify_sql": "select current_setting('huge_pages')",
"expect": "try or off"
},
{
"text": "One async streaming standby is attached; shared_buffers does not have to match between nodes, but both are changed so a failover target has the same memory configuration.",
"verify_sql": "select application_name, state, sync_state from pg_stat_replication",
"expect": "1 row: walreceiver, streaming, async"
},
{
"text": "pg_stat_statements and pg_cron stay in shared_preload_libraries and track_io_timing, autovacuum and archive_mode are untouched; the restart keeps them on (checked in step 6).",
"verify_sql": "select current_setting('shared_preload_libraries'), current_setting('track_io_timing'), current_setting('autovacuum'), current_setting('archive_mode')",
"expect": "pg_stat_statements,pg_cron | on | on | on"
}
],
"steps": [
{
"sql": "do $$ declare v_sb text; v_src text; v_pending text; v_fileerr int := 0; v_txt text; v_lim numeric; v_mem_kb numeric; v_eff numeric; v_hp_total numeric; v_hp_kb numeric; begin select setting, source into v_sb, v_src from pg_settings where name = 'shared_buffers'; if v_sb is distinct from '262144' then raise exception 'R9 guard: shared_buffers is % (8kB pages), expected 262144', v_sb; end if; if v_src = 'command line' then raise exception 'R9 guard: shared_buffers is set on the postmaster command line, ALTER SYSTEM would not take effect'; end if; select string_agg(name, ', ') into v_pending from pg_settings where pending_restart; if v_pending is not null then raise exception 'R9 guard: settings already pending restart would be activated by this restart: %', v_pending; end if; begin select count(*) into v_fileerr from pg_file_settings where error is not null; exception when others then v_fileerr := 0; end; if v_fileerr > 0 then raise exception 'R9 guard: % configuration file entries have errors, a restart is not safe', v_fileerr; end if; begin v_txt := pg_read_file('/proc/meminfo'); v_mem_kb := substring(v_txt from 'MemTotal:[[:space:]]+([0-9]+)')::numeric; v_hp_total := substring(v_txt from 'HugePages_Total:[[:space:]]+([0-9]+)')::numeric; v_hp_kb := substring(v_txt from 'Hugepagesize:[[:space:]]+([0-9]+)')::numeric; exception when others then null; end; begin v_lim := substring(pg_read_file('/sys/fs/cgroup/memory.max', true) from '^[0-9]+')::numeric; exception when others then null; end; if v_lim is null then begin v_lim := substring(pg_read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes', true) from '^[0-9]+')::numeric; exception when others then null; end; end if; v_eff := least(v_mem_kb * 1024, v_lim); if v_eff is not null and v_eff < 6442450944 then raise exception 'R9 guard: memory available to the server is % bytes, too small for about 4.3 GB of shared memory', v_eff; end if; if current_setting('huge_pages') = 'on' then if v_hp_total is null or v_hp_kb is null or v_hp_total * v_hp_kb < 4505600 then raise exception 'R9 guard: huge_pages = on and reserved huge pages cannot hold about 4.3 GB of shared memory, the postmaster would not start'; end if; end if; perform set_config('cr.had_standby', (select count(*) from pg_stat_replication)::text, false); end $$",
"expect": {
"setting:shared_buffers": "==262144",
"oom_kills": "==0"
}
},
{
"config": {
"name": "shared_buffers",
"value": "4GB"
},
"node": "standby",
"expect": {
"oom_kills": "==0"
}
},
{
"sql": "do $$ declare i int := 0; begin if coalesce(nullif(current_setting('cr.had_standby', true), ''), '0') = '0' then return; end if; loop exit when exists (select 1 from pg_stat_replication where state = 'streaming'); i := i + 1; if i > 60 then raise exception 'R9 guard: standby did not resume streaming within 60 s after its restart, the primary is not restarted'; end if; perform pg_sleep(1); end loop; end $$",
"expect": {
"oom_kills": "==0"
}
},
{
"sql": "checkpoint",
"expect": {
"oom_kills": "==0"
}
},
{
"config": {
"name": "shared_buffers",
"value": "4GB"
},
"node": "primary",
"expect": {
"setting:shared_buffers": "==524288",
"oom_kills": "==0"
}
},
{
"sql": "do $$ declare v_sb text; v_pr boolean; begin select setting, pending_restart into v_sb, v_pr from pg_settings where name = 'shared_buffers'; if v_sb is distinct from '524288' or v_pr then raise exception 'R9 check: shared_buffers is % (pending_restart %), expected 524288', v_sb, v_pr; end if; if current_setting('track_io_timing') <> 'on' or current_setting('autovacuum') <> 'on' or current_setting('archive_mode') <> 'on' then raise exception 'R9 check: track_io_timing, autovacuum or archive_mode is not on after the restart'; end if; if current_setting('shared_preload_libraries') not like '%pg_stat_statements%' then raise exception 'R9 check: pg_stat_statements is not preloaded after the restart'; end if; perform count(*) from pg_stat_statements; end $$",
"expect": {
"setting:shared_buffers": "==524288",
"oom_kills": "==0"
}
}
],
"rehearsal": {
"workload": "W_prod",
"minutes": 2,
"metrics": [
"p99_ms",
"tps",
"downtime_s",
"oom_kills",
"io_util_pct",
"checkpoints_req_share",
"setting:shared_buffers",
"setting:track_io_timing",
"setting:autovacuum",
"setting:archive_mode"
],
"thresholds": {
"setting:shared_buffers": "==524288",
"oom_kills": "==0",
"downtime_s": "<30",
"p99_ms": "<1.5x"
}
},
"rollback": [
"select name, setting, source, pending_restart from pg_settings where name = 'shared_buffers'"
],
"postconditions": [
"pg_settings shows shared_buffers = 524288 (4 GB) with pending_restart = false on the primary and on the standby",
"sum(size) from pg_shmem_allocations is about 4.2-4.3 GB on each node, and no OOM kill occurred",
"pg_stat_replication on the primary shows the standby in state streaming, with replay lag back under 1 s",
"track_io_timing = on, autovacuum = on, archive_mode = on, and pg_stat_statements and pg_cron are still loaded; pg_stat_archiver shows no new failures",
"No table rows changed and no jobs, constraints or triggers were added by this CR"
],
"risk": {
"class_guess": "Restart-required memory setting (postmaster GUC): two planned restarts, standby first and then primary; reversible by setting 2GB back with another restart per node.",
"blast_radius": "Whole cluster, briefly. Every connection to the standby and then to the primary is dropped once; open transactions are aborted and clients reconnect. The primary restart is preceded by a CHECKPOINT to keep it short. After each restart the buffer pool is cold, so latency is somewhat higher for the first seconds while pages come back from the OS page cache. Shared memory grows from about 2.15 GB to about 4.3 GB per node. Step 1 checks memory and huge pages on the primary only; the standby cannot be checked from this session, so the 16 GB figure is taken from the task for that node. If the standby does not resume streaming within 60 s, the CR aborts before touching the primary and the Actor restores 2 GB on the standby. The clone cannot show the standby restart, replication lag or standby read latency after a cold start. Not changed here: checkpoints are all WAL-triggered (0 timed, 18 requested with max_wal_size 1 GB); that predates this change and is a separate tuning item."
}
}