CommitFest 6962 review: Improving display of octal GUCs

code-review · generated from canonical Markdown

Type
code-review
Source
postgresql-master
Slug
commitfest-6962-review
Tags
code-reviewcommitfestpostgresqlreview-report-v2
Updated
2026-09-01T09:22:31.128321+00:00
Verdict / Summaryready-for-committer
Front matter
schema: review-report-v2
slug: commitfest-6962-review
source: postgresql-master
target: Improving display of octal GUCs (CommitFest 6962)
base: 8e483af5515ec4ee90d17a3864f5bb764e4e9c47
head: 8e483af5515ec4ee90d17a3864f5bb764e4e9c47
diff_sha: 9bbbbe0c37c8836885062b4af49d719925a27280
verdict: ready-for-committer
blocker_counts:
  verified: 0
  unverified: 0
thread_id: "650240"
thread_subject: Improving display of octal GUCs

CommitFest 6962 Review: Improving display of octal GUCs

Verdict

ready-for-committer

Patch summary

Tom Lane's patch replaces three per-GUC show_hook functions (show_data_directory_mode, show_log_file_mode, show_unix_socket_permissions) with a single GUC_SHOW_IN_OCTAL = 0x010000 flag. The flag is honored in three display/validation paths so that pg_settings min_val/max_val/boot_val/reset_val are displayed in octal alongside the current setting value, eliminating a long-standing inconsistency where the current value was octal but the range columns were decimal.

Changed files (9, +82/-64):

FileChange
src/backend/commands/variable.cRemoved 3 show_hook functions (show_data_directory_mode, show_log_file_mode, show_unix_socket_permissions)
src/backend/utils/misc/READMEAdded note: show_hook controls only current value display; use GUC_SHOW_IN_OCTAL for octal
src/backend/utils/misc/guc.cRefactored parse_and_validate_value error message (3 branches: unit/octal/plain); refactored ShowGUCOption (octal/unit/plain display)
src/backend/utils/misc/guc_funcs.cGetConfigOptionValues PGC_INT uses octal format for min/max/boot/reset
src/backend/utils/misc/guc_parameters.dat3 GUCs now use GUC_SHOW_IN_OCTAL flag; removed show_hook entries
src/include/utils/guc.hNew GUC_SHOW_IN_OCTAL = 0x010000 flag
src/include/utils/guc_hooks.hRemoved 3 show_hook declarations
src/test/regress/expected/guc.outNew test: pg_settings octal display + octal range error
src/test/regress/sql/guc.sqlNew test block

Review seats and provenance

SeatModel routeHandoff slugResult
pg-patch-reviewersonnet-5 (high)commitfest-6962-review-handoff-patch-reviewer0 blockers, 3 nits (all optional/declined)
pg-security-reviewersonnet-5 (xhigh)commitfest-6962-review-handoff-security-reviewerNo security issues
pg-finding-verifiersonnet-5 (xhigh) + opus advisorcommitfest-6962-review-handoff-verifier0 verified, 0 refuted, 0 cannot-verify, 3 not-applicable
pg-change-coverage-reviewersonnet-5 (high)commitfest-6962-review-handoff-coverage18/18 added lines covered; 4 uncovered branches (3 infeasible, 1 pre-existing coverable)
Thread ledgercoordinatorcommitfest-6962-review-thread-ledgerReconciled; 3 LGTMs, 0 objections

Verification Summary

Finding verification status:

The merged finding set from the patch-reviewer and security-reviewer seats contained 0 BLOCKER, 0 MAJOR, 0 MINOR findings. Three NIT-level observations (N1: PGC_REAL branch retains old style; N2: optional errhint for unquoted-octal confusion; N3: test comment accuracy) were all confirmed as optional/declined per the pgsql-hackers thread consensus — the author addressed the sole discussion point (show_hook + GUC_SHOW_IN_OCTAL coexistence) explicitly. No substantive findings required repair verification.

Runtime verification (executed by coordinator in disposable scratch):

Repair Validation Summary

No repairs required. The patch has 0 actionable findings (no blockers, no MAJOR, no MINOR). All three NIT observations are optional and declined per the thread consensus:

No candidate repair patches were validated because no substantive findings required repair. The finding verifier confirmed the empty verification set.

Security Summary

The security review found no security issues:

Test-Gap Summary

The existing test block in src/test/regress/sql/guc.sql covers:

The unit and plain-decimal error branches are covered by pre-existing tests (temp_buffers, default_statistics_target). All added implementation lines are covered. One optional additional test (a positive octal-accept path via ALTER SYSTEM SET log_file_mode = '0640') was considered but not required since the current test's negative-only octal-error coverage is sufficient for the display change.

pgsql-hackers Thread Ledger

Per-finding dispositions from the thread:

Changed-Code Coverage

Coverage requirement

Build and test execution (fresh epoch)

Raw metrics (changed HEAD-side lines)

MetricCount
Changed executable lines18
Covered changed lines18
Compiler-uncovered changed lines0
Uncovered changed lines0
Structural uncovered changed lines0
Changed lines without coverage coordinates33 (braces, whitespace, ereport continuation lines)
Changed branches18
Covered changed branches14

Per-file line coverage

src/backend/utils/misc/guc.c — parse_and_validate_value (lines 3072-3100):

src/backend/utils/misc/guc.c — ShowGUCOption (lines 5413-5442):

src/backend/utils/misc/guc_funcs.c — GetConfigOptionValues (lines 685-712):

Uncovered lines: NONE

All added (HEAD-side) executable lines are covered.

Uncovered branches (4)

FileLineFunctionBranchClassificationReason
guc.c3073parse_and_validate_valueereport fallthrough=falseinfeasible-with-reasonereport(ERROR) longjmps; continuation unreachable. Unit-error branch reached (count=1).
guc.c3083parse_and_validate_valueereport fallthrough=falseinfeasible-with-reasonereport(ERROR) longjmps; continuation unreachable. Octal-error branch reached (count=2).
guc.c3093parse_and_validate_valueereport fallthrough=falseinfeasible-with-reasonereport(ERROR) longjmps; continuation unreachable. Plain-error branch reached (count=1).
guc.c5422ShowGUCOptionif result>0 falsecoverable-nowPre-existing path (result<=0 for unit GUC → unit=""). Trivially coverable: SET statement_timeout = 0; SHOW statement_timeout. Not introduced by this patch.

Test example for the coverable branch (guc.c:5422 false):

sql
-- Exercise the result <= 0 branch of ShowGUCOption unit conversion
SET statement_timeout = 0;
SHOW statement_timeout;
RESET statement_timeout;

Oracle: SHOW statement_timeout must display 0 (value with empty unit suffix), covering the else (unit = "") path at guc.c:5427.

Touched functions

FileFunctionSpanLines (cov/total)Branches (cov/total)Entered
guc.cparse_and_validate_value3028-322047/6639/66yes
guc.cShowGUCOption5389-550252/5732/36yes
guc_funcs.cGetConfigOptionValues625-83877/8419/22yes

COV-* findings

None. All changed implementation lines are covered. The 3 infeasible branches are ereport macro longjmp artifacts. The 1 coverable branch is pre-existing (not patch-introduced) and trivially coverable; it does not meet the test-adequacy rubric threshold for a coverage finding.

Residual limitations

Aggregated Test Plan

  1. src/test/regress/sql/guc.sql — the patch's new test block (pg_settings octal display + octal range error). Passing.
  2. src/test/regress/sql/sysviews.sql — pg_settings query path. Passing.
  3. Manual: unit/octal/plain error branches and display paths (all verified at runtime).

Residual risk

Low. The patch is display-only, well-tested, has 3 LGTMs, no objections, and full changed-code line coverage. The only uncovered branch is a pre-existing, trivially coverable path.

Verified-clean section