CommitFest 6804 Review: log_postmaster_stats
report · generated from canonical Markdown
report
postgresql-master
commitfest-6804-review2026-08-31T01:50:51.422375+00:00
Front matter
schema: review-report-v2 target: "log_postmaster_stats GUC - periodically log postmaster connection/CPU statistics (CommitFest 6804)" base: 92819e57945d106317eaaa4273180dd8663f91bd head: 92819e57945d106317eaaa4273180dd8663f91bd scope_identity: diff-e20ef1973d1da42128e5ea581ef718fe2ed14374 diff_sha256: 27de5b7e9dc78b7a3eb45b503b38dc2fa47e9df22c6d4a0165dc5d194572598b diff_blob_sha: e20ef1973d1da42128e5ea581ef718fe2ed14374 verdict: waiting-on-author blocker_counts: verified: 1 unverified: 0 model: glm-5.2:cloud model_policy_version: 1 model_policy_hash: 997c035512fa1b35aa17149ea386a861af531ec05839ce06810f38268a3caebe source: postgresql-master slug: commitfest-6804-review
CommitFest 6804 Review — log_postmaster_stats
Verdict
PostgreSQL readiness: waiting-on-author
- 1 verified BLOCKER-class process finding (PAT-1: thread scope drift); 2 MAJOR behavior/test findings verified (PAT-2 idle flood, PAT-3 weak TAP test); 4 MINOR/NIT verified (PAT-4, PAT-7, PAT-8, COV-1); 5 refuted (SEC-1, SEC-2, SEC-4, SEC-5, SEC-6).
- Blocker split: verified 1, unverified 0.
- The worktree is a sound, low-risk implementation of the original M1
log_postmaster_statsinterval-logger design, but the pgsql-hackers thread has drifted (author M6/M8 renamed/expanded the concept tolog_postmaster_overloads+log_postmaster_excess_connections; committer Robert Haas M7 proposed dropping the CPU/rusage path). No on-list message confirms the simple variant is still the intended landing target — gating PAT-1. - The committer-corroborated idle-flood issue (PAT-2) is unaddressed and must be fixed or waived before commit.
Scope
- Target: uncommitted-worktree-diff vs HEAD
92819e57945d106317eaaa4273180dd8663f91bd(origin/master). - Scope identity:
diff-e20ef1973d1da42128e5ea581ef718fe2ed14374(diff sha25627de5b7e9dc78b7a3eb45b503b38dc2fa47e9df22c6d4a0165dc5d194572598b). - Diff stat: 9 files, +151 / -3.
- Changed instrumentable paths:
src/backend/postmaster/postmaster.c,src/backend/postmaster/bgworker.c. - Changed symbols:
GetParallelWorkerRegisterCount(new, bgworker.c);DetermineSleepTime,ServerLoop,CleanupBackend(modified, postmaster.c). - New GUC:
log_postmaster_stats(int,PGC_SIGHUP,LOGGING_WHAT,GUC_UNIT_S, 0..86400, boot 0). - New test:
src/test/postmaster/t/005_log_postmaster_stats.pl. - The reviewed worktree is read-only. All candidate production edits, tests, builds, clusters, and coverage counters existed only in disposable scratch.
Wiki "Reviewing a Patch" six-heading summary
- What it does: Adds a SIGHUP GUC
log_postmaster_stats(seconds, default 0=off). When positive, the postmaster periodically emits aLOGline with connection rate, disconnection rate, parallel-worker-start rate, and postmaster CPU/elapsed usage (pg_rusage_show).DetermineSleepTimecaps wakeups to the configured interval. - Does it work: Yes, mechanically. Compiles cleanly against HEAD; the logic is straightforward and consistent with existing periodic-block patterns in
ServerLoop. No crash/assertion path found. Verified non-findings: locklessparallel_register_countread (PAT-6/SEC-1) andDetermineSleepTimecap (PAT-5) are correct. - Performance: One
getrusage+gettimeofdayper interval (≥1s); negligible vs fork() cost. Unlocked shared-memory read is the established postmaster pattern. No hot-path cost when=0. - Security: No new external input, no privilege change, no catalog access,
getrusage(RUSAGE_SELF)is process-local. No security finding (SEC-1/SEC-4 refuted as security issues; SEC-2/SEC-5/SEC-6 informational non-findings). - Smarter approaches: The unresolved idle-flood (PAT-2) is the main design smell; the author's own later thread direction (overload-oriented GUCs) and Robert Haas's M7 cumulative-stats/connection-rate proposal are competing, arguably smarter approaches. The simple periodic GUC and the overload GUCs should be reconciled on-list (PAT-1).
- Conclusion: Sound, low-risk implementation hampered by an open design/process question and a weak test. Address PAT-1 (thread confirm), PAT-2 (idle flood), PAT-3 (test strength), then
ready-for-committer.
Findings
Severity scale: BLOCKER > MAJOR > MINOR > NIT.
— BLOCKER (process, UNVERIFIED) — thread alignment / scope drift
- Where: whole patch (design), referencing thread 646913 (msgs 2026-07-27 M6, 2026-07-28 M7, 2026-07-30 M8).
- Mechanism: The worktree implements the original M1
log_postmaster_statsinterval-logger design. The author's latest postings (M6/M8) renamed/expanded the concept tolog_postmaster_overloads+log_postmaster_excess_connections, and committer Robert Haas (M7) proposed dropping the CPU/rusage path for a purelog_excessive_connection_rate=N. There is no on-list message confirming the simple variant is still the intended landing target. - verification_status: cannot-verify (process/design alignment question; no code patch can verify or resolve it). Labelled UNVERIFIED. Classified BLOCKER-class per the harness verdict rules.
- verification_reason: A code proposal here would be unsafe/misleading — committing without the author's on-list confirmation risks landing a design the thread no longer endorses.
- Repair (waived, process): Post an on-list message asking the author (Jakub Wartak) to confirm whether the simple single-GUC
log_postmaster_statsvariant is still the intended landing target, or whether the worktree is stale relative to the M6-M8 renamed two-GUC direction. No commit should proceed until resolved on-list. No code patch, no validation, no test (typed safety waivers:design-choice).
— MAJOR (behavior) — idle-database log flood (committer-corroborated, unaddressed)
- Where:
src/backend/postmaster/postmaster.cServerLoop stats block (~1854-1888); GUClog_postmaster_stats. - Mechanism: When the cluster is idle,
conn_delta == disc_delta == pqw_delta == 0on every interval, yet the block unconditionally emits aLOGline. Reviewer Quan Zongliang raised this (2026-06-10); committer Robert Haas corroborated the zero-counter suppression fix (2026-07-20: "omitting the line altogether when all the counters were zero would be sensible"). The worktree does NOT implement suppression. - verification_status: verified (method: two-run TAP gate).
- verification_evidence: Two-run gate (independent, verify-scratch): un-repaired 006 idle-skip FAIL (Tests=2 Failed=2; Phase 1 saw idle 0.00-rate line; Phase 2 elapsed=2.10s < 3s floor); repaired 006 PASS (Tests=2 6s).
- Repair (passed): Suppress the
ereportwhen all three deltas are zero AND leave baselines/last_pmstats_time/pg_rusage_inituntouched so the next non-idle window covers the full quiet period. Add anelsebranch on theelapsed > 0guard that resets baselines defensively for the time-jumped-backwards case. - Patch:
src/backend/postmaster/postmaster.c(unified-diff bound to HEAD92819e57945d106317eaaa4273180dd8663f91bd); sha2568aa94a546036e0de6dcc233e85fbf450b2cbf3de91488c9af011049e1ef1a053. - Validation: apply-check/apply/diff-check OK;
postmaster.ocompiles with-Wall -Werror=vla(gcc 15.2.0) no warnings; relink OK; 006 two-run gate FAIL→PASS. - Test example:
src/test/postmaster/t/006_log_postmaster_stats_idle_skip.pl(new, 98 lines, in test-patches.patch). Oracle: Phase 1 no line while idle ≥5s; Phase 2 first non-idle line elapsed ≥3s.
— MAJOR (tests) — TAP test fragile / under-covers
- Where:
src/test/postmaster/t/005_log_postmaster_stats.pl. - Mechanism: (a)
$offsetcaptured beforesafe_psqlbut postmaster may emit during startup; (b) loose regex only checksconns/sec, never validatesdisconns/parallel/CPU; (c) no interval-timing assertion; (d) redundantpass(). - verification_status: verified (method: inspection + two-run gate).
- verification_evidence: Reconciled strengthened 005 PASSED on the repaired build (8 tests, 10-11s). The test-author's original strengthened 005 was reconciled (Test 1 issues
SELECT 1before waiting) to remain compatible with the PAT-2 idle-skip repair; the original would time out at Test 1 on the repaired build. Actual patched bytes validated. - Repair (passed): Replace 005 with the reconciled strengthened version (full-field
STATS_RE; disconnection/parallel/SIGHUP coverage; Test 1 issuesSELECT 1before waiting). Add 006 idle-skip negative test. Register 006 inmeson.build. - Patch:
src/test/postmaster/t/005_log_postmaster_stats.pl+t/006_...+meson.build(unified-diff bound to HEAD); sha2561cfb94614c9d88bf8313700fafdc40218c773154a958cd60110d180f373013a9. - Validation: apply-check/diff-check OK; on fully-patched build 005 PASS (8 tests 11s), 006 PASS (2 tests 6s); 006 two-run gate FAIL un-repaired / PASS repaired.
— MINOR (docs) — pg_rusage elapsed vs time_t elapsed divergence
- Where:
src/backend/postmaster/postmaster.c:1861(time_t elapsed) vs:1880(pg_rusage_show). - Mechanism: Rates use coarse
time_tseconds; CPUelapsedusesgettimeofdaymicroseconds. The two "elapsed" figures can diverge by up to ~1s. Cosmetic; author self-noted on-list (M1). - verification_status: verified (inspection). Stands under the worktree's M1 design; likely moot under Robert M7's drop-CPU direction.
- Repair (passed): Combined SGML patch adds a precision note. Patch sha256
49ff579803ac070261bb168a495bdc41127c981f0a62b95408dd0f2bff81c081(with PAT-7/PAT-8). Validation: apply/diff-check OK;make -C doc/src/sgml postgres.htmlsucceeds withxmllint --valid.
— MINOR (docs, new) — SGML disconnection wording loose
- Where:
doc/src/sgml/config.sgml(~8500); codepostmaster.c:2690+miscadmin.h:418. - Mechanism: SGML says the connection rate counts regular+replication but does not state the disconnection rate is likewise limited to
B_BACKEND/B_WAL_SENDERexits. - verification_status: verified (inspection). Genuinely new; no thread discussion.
- Repair (passed): Combined SGML patch rewords to cover both rates. Patch sha256
49ff579803ac070261bb168a495bdc41127c981f0a62b95408dd0f2bff81c081. Validation: doc-build PASS.
— NIT (docs, new) — SGML sample wrapped across two physical lines
- Where:
doc/src/sgml/config.sgml(~8497-8498). - Mechanism: The
<screen>sample wrapspostmaster stats:across two lines while the actualereportproduces a single-line LOG. - verification_status: verified (inspection). Genuinely new; no thread discussion.
- Repair (passed): Combined SGML patch renders the sample as one line. Patch sha256
49ff579803ac070261bb168a495bdc41127c981f0a62b95408dd0f2bff81c081. Validation: doc-build PASS.
— MINOR (tests, verified-by-coverage) — disabled-GUC default path untested
- Where:
src/backend/postmaster/postmaster.c:1656(and line 1653 false branch). - Mechanism: The disabled-GUC default path (
log_postmaster_stats == 0) is untested.DetermineSleepTimeline 1653 false branch and line 1656 (return 60 * 1000) are gcov count 0 under the shipped 005 test; reachable with a standard TAP cluster started with the GUC at its default. This is the symmetric negative case and a regression guard that the disabled GUC is a true no-op. - verification_status: verified (method: verified-by-coverage).
- verification_evidence: Fresh-epoch gcov (coverage seat): line 1656 count 0; line 1653 false branch count 0. Re-validated (cov-revalidate handoff): 008 test passed twice (4.55s, 5.07s) on the patched tree; fresh-epoch gcov shows line 1656 count 0→12 and line 1653 false branch 0→12. Coverage gap closed. Existing 005 coverage retained.
- coverage_reference:
src/backend/postmaster/postmaster.c:1656(line). - Repair (passed): Add
src/test/postmaster/t/008_log_postmaster_stats_disabled.pl+ register inmeson.build. Patch sha2561458e1e28bb74ad55f52b6e39ed980a044bfe68907c6974ef2bfc594cd61abdc. Validation: apply/diff-check OK; coverage build OK (2401/2401 targets); 008 PASS twice; full postmaster suite 6/6 OK; fresh-epoch gcov confirms line 1656 0→12 and line 1653 false branch 0→12.
Refuted findings (kept in report, not in counts)
- SEC-1 / PAT-6 (MINOR, refuted-as-security-issue): unlocked read of
parallel_register_countinGetParallelWorkerRegisterCount(bgworker.c:247). Matches the existing accepted postmaster pattern (bgworker.c:88-100;parallel_terminate_countalready read locklessly).uint32aligned load is atomic on supported platforms. No privilege boundary crossed. Optionalpg_read_barrier()clarity nit, not a required repair. - SEC-4 (MINOR, refuted-as-security-issue): tiny-interval self-DoS via log volume (
guc_parameters.dat:1828). Reload is superuser-gated (pg_reload_confproacl={POSTGRES=X};ALTER SYSTEMsuperuser-only). The config-write principal can already drown logs vialog_statement='all'. Operator foot-gun, not a privilege-boundary vuln. Subsumed by PAT-2. - SEC-2 (NIT, refuted):
pqw_deltauint32wraparound (postmaster.c:1873). Modular subtraction correct perbgworker.c:93-100; per-window count « 2^32. Informational. - SEC-5 (NIT, refuted):
time_tbackwards jump handling (postmaster.c:1857,1869-1871).elapsed > 0guard is correct; PAT-2 repair formalizes the defensiveelse. Informational. - SEC-6 (NIT, refuted):
pg_rusage_showstatic buffer (pg_rusage.c:42). Postmaster single-threaded inServerLoop; pre-existing accepted pattern. Informational.
Verification Summary
| # | Finding | Severity | verification_status | method | repair.validation |
|---|---|---|---|---|---|
| PAT-1 | scope drift / process | BLOCKER | cannot-verify (UNVERIFIED) | inspection (thread ledger) | waived (process) |
| PAT-2 | idle-database log flood | MAJOR | verified | two-run (TAP) | passed |
| PAT-3 | 005 fragile/under-covers | MAJOR | verified | inspection + two-run | passed |
| PAT-4 | rusage vs time_t elapsed divergence | MINOR | verified | inspection | passed (doc-build) |
| PAT-7 | SGML disconnection wording loose | MINOR | verified | inspection | passed (doc-build) |
| PAT-8 | SGML sample wrapped across two lines | NIT | verified | inspection | passed (doc-build) |
| COV-1 | disabled-GUC default path untested | MINOR | verified | verified-by-coverage | passed |
| SEC-1 / PAT-6 | unlocked read of parallel_register_count | MINOR | refuted-as-security-issue | inspection | not-applicable-refuted |
| SEC-4 | tiny-interval self-DoS | MINOR | refuted-as-security-issue | inspection | not-applicable-refuted |
| SEC-2 | pqw_delta uint32 wraparound | NIT | refuted | inspection | not-applicable-refuted |
| SEC-5 | time_t backwards jump | NIT | refuted | inspection | not-applicable-refuted |
| SEC-6 | pg_rusage_show static buffer | NIT | refuted | inspection | not-applicable-refuted |
Counts: verified = 6 (PAT-2, PAT-3, PAT-4, PAT-7, PAT-8, COV-1); cannot-verify = 1 (PAT-1, UNVERIFIED); refuted = 5 (SEC-1, SEC-4, SEC-2, SEC-5, SEC-6). Verified BLOCKER/MAJOR: PAT-1 (blocker-class process), PAT-2 (MAJOR behavior), PAT-3 (MAJOR tests). Unverified BLOCKER/MAJOR: 0.
Repair Validation Summary
All verified code/test findings carry concrete HEAD-bound unified diffs validated in disposable scratch (apply-check, apply, diff-check, build, targeted-test, two-run gate / coverage as applicable). PAT-1 is a process repair with a typed safety waiver (design-choice) and no code patch.
| Patch | files | sha256 | validation |
|---|---|---|---|
| pat2-repair.patch | src/backend/postmaster/postmaster.c | 8aa94a546036e0de6dcc233e85fbf450b2cbf3de91488c9af011049e1ef1a053 | passed: apply, compile, 006 two-run gate (FAIL→PASS) |
| test-patches.patch | src/test/postmaster/t/005_…, t/006_…, meson.build | 1cfb94614c9d88bf8313700fafdc40218c773154a958cd60110d180f373013a9 | passed: apply, 005+006 run on repaired; 006 two-run gate |
| sgml-repair.patch | doc/src/sgml/config.sgml (PAT-4/PAT-7/PAT-8) | 49ff579803ac070261bb168a495bdc41127c981f0a62b95408dd0f2bff81c081 | passed: apply, doc-build (postgres.html + xmllint --valid) |
| test-cov1.patch | src/test/postmaster/t/008_…, meson.build | 1458e1e28bb74ad55f52b6e39ed980a044bfe68907c6974ef2bfc594cd61abdc | passed: apply, coverage build, 008 PASS (×2), fresh-epoch gcov 0→12 |
A successful repair does not prove a finding, and a failed repair does not refute it. Finding verification and repair validation never override one another.
Changed-Code Coverage
Coverage requirement: required (changed instrumentable implementation in src/backend/postmaster/postmaster.c and src/backend/postmaster/bgworker.c).
Execution lane: host-disposable (passed). Fresh meson coverage build (b_coverage=true, buildtype=debug, cassert=true, tap_tests=enabled, readline=disabled, icu=disabled) at frozen HEAD + scope diff; postgresql:postmaster/005_log_postmaster_stats OK 1 subtest passed 2.32s; durable test.success marker present; "postmaster stats:" LOG lines present in primary log. No nested-sandbox attempt needed.
Fresh disposable counter epoch: disposable source = fresh git clone of HEAD 92819e57945d106317eaaa4273180dd8663f91bd, scope diff applied with git apply --index (scope diff sha256 verified 27de5b7e…, matches scope identity). .gcno count 1650. After --suite postgresql:setup produced 1016 .gcda, all .gcda were deleted and asserted zero immediately before the measured test run: FRESH_EPOCH_PRE_TEST: gcda_count=0. The measured test then ran exactly once under LC_ALL=C LANG=C TZ=UTC; after the run 974 .gcda files including postmaster_postmaster.c.gcda and postmaster_bgworker.c.gcda. No shared/user build counters were touched.
Test set (exact executed command):
meson test -C <cov-scratch>/mbuild --no-rebuild -j1 --print-errorlogs postgresql:postmaster/005_log_postmaster_stats
Per-test status: selected=1, started=1, passed=1, failed=0, skipped/gated=0, timed-out=0. PRIMARY measurement is against the patch-as-shipped 25-line 005 test (the test set the harness is measuring). The strengthened reconciled 005 + 006 in verify-scratch are candidate repairs, not part of this measurement.
Integrity cross-check: filtered gcovr JSON vs raw gcov --json-format --stdout --branch-probabilities --branch-counts — 1669 common line coordinates, 0 disagreements → PASS. integrity_errors: [].
Raw metrics:
| metric | value |
|---|---|
| changed executable lines | 32 |
| covered changed lines | 29 (90.6%) |
| compiler-uncovered changed lines | 3 |
| semantic uncovered changed lines | 3 |
| structural uncovered changed lines | 0 |
| changed lines without coverage coordinates | 46 (declarations, comments, braces, #include, GUC table rows — non-instrumentable) |
| changed branches | 10 |
| covered changed branches | 6 (60.0%) |
| uncovered branches | 4 |
Invariants: covered(29) + compiler-uncovered(3) = changed executable(32); semantic(3) + structural(0) = compiler-uncovered(3); covered-branches(6) + uncovered-branch-records(4) = changed-branches(10).
Touched-function diagnostics (whole-function, diagnostics only):
| function | file | entered | whole-function lines (cov/total) | whole-function branches (cov/total) |
|---|---|---|---|---|
| GetParallelWorkerRegisterCount | bgworker.c | yes (count 3) | 2/2 | 0/0 |
| DetermineSleepTime | postmaster.c | yes (count 13) | 8/32 | 5/22 |
| ServerLoop | postmaster.c | yes (count 1) | 49/66 | 23/36 |
| CleanupBackend | postmaster.c | yes (count 2) | 31/39 | 15/22 |
Uncovered changed regions (semantic):
- U1 —
DetermineSleepTimelines 1648-1649 (if (log_postmaster_stats > 0) ms = Min(ms, log_postmaster_stats * 1000);), gcov count 0. Coverability:requires-special-harness-or-injection-point. The enclosingif (next_wakeup != 0)at line 1641 took only its false branch across all 13 calls (next_wakeupwas 0 in the idleSELECT 1workload). Reaching this needs either an io-worker-scheduling-pressure workload, a crashed autorestart bgworker, or apm_force_next_wakeupinjection point. Test skeletont/007_log_postmaster_stats_sleepwakeup.plprovided (skips absent the injection point). - U2 —
DetermineSleepTimeline 1656 (return 60 * 1000;), gcov count 0. Coverability:coverable-now. The default-disabled return path; reachable by starting a postmaster with the GUC at its default0. The shipped 005 only enables the GUC. COV-1 finding with concrete test-patch repairt/008_log_postmaster_stats_disabled.pl(re-validated: 008 PASS ×2; fresh-epoch gcov line 1656 0→12, line 1653 false branch 0→12).
Uncovered changed branches (zero-count decision outcomes):
- B1 —
DetermineSleepTimeline 1648true(count 0):requires-special-harness-or-injection-point(needsnext_wakeup!=0); see U1 skeleton. - B2 —
DetermineSleepTimeline 1648false(count 0):requires-special-harness-or-injection-point(needsnext_wakeup!=0ANDlog_postmaster_stats==0); combine U1 injection with U2 disabled-GUC start. - B3 —
DetermineSleepTimeline 1653false(count 0):coverable-now(the disabled-GUC path; covered by the U2/COV-1 008 test). - B4 —
ServerLoopline 1869false(if (elapsed > 0), count 0):infeasible-with-reason(typed waiver: defensive clock-skew guard;elapsedis provably>= log_postmaster_stats >= 1at this point under a monotonic clock; forcing a backwards time jump between twotime(NULL)calls in the same process iteration is not achievable through any standard test interface. Revisit if apm_clock_step_backwardinjection point is added.).
Excluded changed coordinates (bounded, non-actionable): 8 compiler-no-coverage-coordinate in bgworker.c (comments, signature, braces); 38 in postmaster.c (#include, file-scope/static declarations, local declarations, comments, braces); 4 compiler-branch-attribution at postmaster.c lines 1859/1875 (raw compiler CFG arcs without a matching source-level conditional decision). These 46 compiler-no-coverage-coordinate lines are non-instrumentable and do not produce COV-* findings.
Non-instrumented changes (separate): doc/src/sgml/config.sgml (docs), guc_parameters.dat (catalog metadata), postgresql.conf.sample (sample config), postmaster.h/bgworker_internals.h (declarations), meson.build (build file), 005_log_postmaster_stats.pl (the measured test itself).
Residual limitations: branch coverage from gcovr --decisions (experimental heuristic; raw gcov used for integrity cross-check only); measured test set is exactly {postgresql:postmaster/005_log_postmaster_stats}; percentages qualified to this set; DetermineSleepTime whole-function branch coverage low because bgworker-restart/io-worker branches not exercised by idle SELECT 1 (only changed lines in scope); single fresh-epoch invocation, no counter accumulation.
The normalized machine object is in review-artifact-v2.json (coverage), validated by validate_review_artifact.py (exit 0).
Thread ledger (pgsql-hackers)
Status: reconciled. Ledger report slug: commitfest-6804-review-thread-ledger. Single thread: all 8 messages share imported thread_id 646913 (subject "log_postmaster_stats"). Catversion exception applied (GUC-only development-branch patch; no catalog/OID/.bki change; no catversion/CATALOG_VERSION_NO impact).
| # | Date (UTC) | Message-ID | Sender | Kind |
|---|---|---|---|---|
| 1 | 2026-05-27 | CAKZiRmxeTNAe_VZ9m=rt=5155mvL=CFsQ4ENJWhuUdgMe=_Udg@mail.gmail.com | Jakub Wartak | patch v1 |
| 2 | 2026-06-10 | 164cb42a-52da-44b1-88d0-3f505ca5238b@yeah.net | Quan Zongliang | review |
| 3 | 2026-06-10 | CAKZiRmzBZo7Ycm_f6z1+PEewmfaby9Tu=Jhm0TOYSa+nzjZmmA@mail.gmail.com | Jakub Wartak | author reply |
| 4 | 2026-07-20 | CA+TgmoZLAr2Y8ZRpxCg5oQa8qGUh3pXTB2mMkM9EnDoUaSUV9Q@mail.gmail.com | Robert Haas | committer reply |
| 5 | 2026-07-23 | CAKZiRmxEz9zQKHdb3VNiZVh9PT2JDBo8sivBEY0giecSAaFxrA@mail.gmail.com | Jakub Wartak | author reply |
| 6 | 2026-07-27 | CAKZiRmy+qqox8XSk+cd+c7XmbGZHHpnAHOg3D-Ho-atuQRP4fg@mail.gmail.com | Jakub Wartak | patch v2/v3 |
| 7 | 2026-07-28 | CA+Tgmob7xpq3-ds536jo5vdenGJJ_rm5-okr7G-1F=5sU6HF9g@mail.gmail.com | Robert Haas | committer reply |
| 8 | 2026-07-30 | CAKZiRmx996hSedQ9BW6v2qj092tUoZZiUHWHyD9YRyhxT8gvXg@mail.gmail.com | Jakub Wartak | patch v3 |
Per-finding dispositions: PAT-1 already-raised (M6/M7/M8); PAT-2 committer-corroborated (M2/M3/M4); PAT-3 already-raised (M6); PAT-4 author-deferred (M1/M7); PAT-7/PAT-8/COV-1 new; SEC-1 new; SEC-4 already-raised (subsumed by PAT-2); SEC-2/SEC-5/SEC-6 new.
Thread issues not in the review seats: Robert Haas's cumulative-stats architecture objection (M4/M7) — a committer stated preference that this kind of metric belong in pgstats, not logs — should be answered on-list.
Aggregated Test Plan
| Artifact | Type | Status | Validates |
|---|---|---|---|
src/test/postmaster/t/005_log_postmaster_stats.pl (reconciled) | TAP | PASS on repaired (8 tests) | all fields, disconnections, parallel workers, SIGHUP |
src/test/postmaster/t/006_log_postmaster_stats_idle_skip.pl (new) | TAP negative | two-run gate (FAIL un-repaired / PASS repaired) | PAT-2 idle-skip + quiet-period accumulation |
src/test/postmaster/t/008_log_postmaster_stats_disabled.pl (new) | TAP | PASS (×2); full postmaster suite 6/6 OK | COV-1 disabled-GUC no-op + line 1656 coverage |
Security and test-gap sections
- Security: No security finding. SEC-1 (unlocked read) and SEC-4 (tiny-interval self-DoS) refuted as security issues; SEC-2/SEC-5/SEC-6 informational non-findings. The new GUC is
PGC_SIGHUP+ superuser-gated reload; no unprivileged role can enable it. Disclosure is aggregate rates + postmaster CPU, strictly less sensitive thanlog_connections/log_disconnections. - Test gaps: PAT-3 (005 fragile/under-covers), PAT-2 (idle-flood negative test), COV-1 (disabled-GUC path). All have concrete validated test-patch repairs.
Per-commit rollup / verified-clean / residual risk
- Per-commit rollup: N/A — the target is an uncommitted worktree diff (no commit history to roll up).
- Verified-clean (non-findings): PAT-5 (
DetermineSleepTimecap correct in all branches), PAT-6/SEC-1 (unlockedparallel_register_countread — accepted existing pattern), SEC-2/SEC-5/SEC-6 (informational). The memory-context false-positive filter was applied: nopallocin a reset context, no dangling pointers, noCHECK_FOR_INTERRUPTSconcern, no catalog/version drift (catversion bump not required),ereport(LOG)style matches surrounding postmaster logging. - Residual risk: PAT-1 (process) is the gating item — until the author confirms on-list that the simple
log_postmaster_statsvariant is the intended landing target, the code-level repairs (PAT-2, PAT-4) may be moot if the thread's M6-M8 two-GUC / drop-CPU direction prevails. The code repairs here are scoped to the worktree's current (M1) design. The reconciled 005 Test 1 diverges from the test-author's original by issuingSELECT 1before the firstwait_for_logto remain compatible with the PAT-2 idle-skip repair; the actual patched bytes were validated (PASS on repaired build).
Provenance
- Coordinator: pg-review-harness (model glm-5.2:cloud, user override; router policy v1 hash
997c0355…). - Seats: pg-patch-reviewer, pg-security-reviewer (delegated C memory-safety in-scope), pg-test-author (proposal-only), cross-reference-review-with-thread, pg-finding-verifier (full + COV-1 repair-validation mode), pg-change-coverage-reviewer.
- Handoff reports (source
postgresql-master):commitfest-6804-review-handoff-patch-reviewer(sha65ea0ba7…),…-security-reviewer(shae4c4096a…),…-test-author(shacc744fb0…),…-thread-reconciler(sha4c3bc991…),…-finding-verifier(sha78e77d1b…),…-coverage(sha15882994…),…-cov-revalidate(sha2dc39314…). Canonical thread ledger:commitfest-6804-review-thread-ledger. - Validated artifact:
review-artifact-v2.json(schemapg-review-artifact-v2), validated byvalidate_review_artifact.py(exit 0). - Maintainer CC: maintainer lookup via
amautafor the touched postmaster subsystem. - All citations are repo-relative. No local absolute paths or credentials are persisted. The reviewed worktree was not modified, staged, committed, or pushed.
UI
- Canonical report: http://127.0.0.1:8848/ui/reports/postgresql-master/commitfest-6804-review