release: fix reader privilege blockers and sample slot race - #181
Conversation
|
Pre-merge verification complete after rebasing onto Conflict resolution:
RED / GREEN:
The rebuilt ACL logic remains dynamic: it derives the non-admin helper closure rather than freezing a function list. This is important for the upcoming #189 helper; after #189 lands I will explicitly verify Targeted PostgreSQL verification passed for all three scenarios, YAML parses, |
|
CI follow-up: the first rebased run exposed a stale v1.5 upgrade-test oracle, not a product regression. The upgrade correctly scrubbed the legacy reader grant on newly-admin Fixed in |
Separate exact physical raw coverage from the reusable minute-aligned planning boundary, keep source attribution tied to physical evidence, and make tie-drill remediation preserve partial first minutes. Rebase resolution retains #185's day-granular rotation contract and scales #189's synthetic retention fixtures instead of weakening validation. #181's dynamic reader grant bundle includes the new _raw_oldest_sample() helper (41 current non-admin functions). Fixes #163.
Preserve honest retained grain across aas, timeline, top, compare, chart, summary, and v1.5 backfills; disclose effective plans and mark legacy/incomplete hourly detail as rollup_1h_flat.\n\nThe final rebase preserves #189's physical/logical raw-retention split and #181's dynamic reader grants. The Codex review's full-archive scan finding is fixed by keeping _rollup_1h_has_flat() indexable. Fixes #161, #168, #175, and #130; supersedes #131.
Closes #164.
Closes #166.
Closes #169.
What changed
pg_monitorbundle, acrossash.rebuild_partitions()by reusing the installer's_ash_install_reader_rolessnapshot/replay mechanism.ash.revoke_reader()when its target owns schemaash, iscurrent_user, or is a superuser. Keep_admin_funcs()out of reader grants and scrub its legacy EXECUTE grant during installer re-apply.ash.samplerow with the already capturedv_current_slot, so packed query-map IDs and their slot cannot diverge during rotation.Regression coverage
rebuild_partitions(6, 'yes'); immediate empty-reader smoke test; delayed sample insertion; custom reader plus a plainpg_monitormember._admin_funcs()ACL re-apply coverage.ash.current_slot()transition proves the sample uses the captured slot and reads it once; exact query attribution andinsert_errors = 0; normalized function-definition assertion proves there is exactly oneash.sampleINSERT path and that it namesslotexplicitly.Local validation
git diff --checkThe N2 behavioral probe deterministically forces the slot transition. Its tagged one-active-backend fixture is controlled in CI, but—as with any
pg_stat_activityfixture—could be perturbed by an unexpected concurrent client in a shared local database; the structural assertion remains fully deterministic.This draft was rebased onto current
origin/mainimmediately before push. It still needs a fresh rebase ontoorigin/mainbefore merge.