CommitFest 6632 review - test_extensible

report · generated from canonical Markdown

Type
report
Source
postgresql-master
Slug
commitfest-6632-review
Tags
commitfest-6632pg-review-harnessreview-report-v2waiting-on-author
Updated
2026-08-30T10:40:21.329653+00:00
Verdict / Summarywaiting-on-author
Front matter
schema: review-report-v2
target: CommitFest patch 6632 - test_extensible module (src/test/modules/test_extensible/), uncommitted staged diff
base: 2fb8da5a245661287833b05a1b2e275ddf83bbd7
head: 2fb8da5a245661287833b05a1b2e275ddf83bbd7
diff_sha256: 4cf5dcf4e9af59202871de5c6706b41e4c2ef98286e8e29674fa8b898d10a439
verdict: waiting-on-author
blocker_counts:
  verified: 1
  unverified: 0
seats:
  - pg-patch-reviewer (glm-5.2:cloud)
  - pg-security-reviewer (glm-5.2:cloud)
  - pg-finding-verifier (glm-5.2:cloud)
  - thread-reconciler
artifact: pg-review-artifact-v2 (validated)

CommitFest 6632 — test_extensible Module Review

Verdict

waiting-on-author — one verified BLOCKER (compile error) must be fixed before the module can build. Blocker split: 1 verified, 0 unverified.

The patch adds a new test module src/test/modules/test_extensible/ exercising the ExtensibleNode and CustomScan registration/lookup APIs in src/backend/nodes/extensible.c. No core backend file is modified; this is a test-only patch.

Scope

no commits beyond base — pure additions)

test_ext_node_out, test_ext_node_read, test_begin_custom_scan, test_exec_custom_scan, test_end_custom_scan, test_rescan_custom_scan, test_create_custom_scan_state, test_plan_custom_path, test_set_rel_pathlist, test_get_extensible_node_methods, test_get_custom_scan_methods, _PG_init

Findings

B1 — BLOCKER, correctness — compile error in test_ext_node_read

(ExtensibleNode *node), but ExtensibleNodeMethods.nodeRead now requires void (*)(ReadNodeContext *ctx, ExtensibleNode *node) (src/include/nodes/extensible.h:73). Inside, pg_strtok(&length) is called with 1 arg, but the current signature is pg_strtok(ReadNodeContext *ctx, int *length) (src/include/nodes/readfuncs.h:37). Core's _readExtensibleNode calls methods->nodeRead(ctx, local_node) (src/backend/nodes/readfuncs.c:565). This is a hard compile error from function-pointer type mismatch; the module cannot build.

signatures. A gcc -c type probe reproduces 3 compile errors; the repair probe compiles cleanly with -Wall -Werror.

ExtensibleNode *node), thread ctx into both pg_strtok calls, and replace atoi(token) with pg_strtoint32(tok)` (also resolves n-atoi).

full build tree available)

refactor postdates the thread's "looks good").

M1 — MAJOR, tests — nodeOut/nodeRead/nodeCopy/nodeEqual untested

nodeCopy, nodeEqual are registered but never exercised by any SQL test step. The SQL only runs EXPLAIN (COSTS OFF) + SELECT. nodeOut is reachable only via nodeToString (outfuncs.c:496) and nodeRead only via stringToNode/parseNodeString (readfuncs.c:569), neither triggered here. Half the ExtensibleNodeMethods surface is untested despite the module's stated purpose.

the plan tree (only result tuples); the plan-tree nodeToString path is parallel query (execParallel.c:152,233). The repair uses nodeToString+stringToNode directly via a SQL-callable C function.

TestExtNode, serializes via nodeToString, reparses via stringToNode, copies via test_ext_node_copy, compares via test_ext_node_equal, and returns the reparsed repeat_count. Add the CREATE FUNCTION declaration and two SELECT test steps. (Requires B1 fix.)

(combined B1+M1)

no tests for nodeCopy, nodeEqual, nodeOut, and nodeRead routines" (2026-07-28).

m1 — MINOR, maintainability — get_rel_name leak

planner context; never freed. Bounded leak (context reset at query end). PG memory-context filter → minor.

and after the match check.

m2 — MINOR, maintainability — comment/code mismatch (cost = 0)

sets startup_cost = total_cost = 0. Zero cost makes the custom path always win; comment is inaccurate.

our custom scan."

m5 — MINOR, correctness — clauses dropped (qual = NIL)

cscan->scan.plan.qual = NIL. Correct for current tests (no WHERE) but would silently drop quals if tests extended.

cscan->scan.plan.qual = (List *) clauses.

n-atoi — NIT, correctness — atoi with no overflow handling

constrained by Assert(tnode->repeat_count > 0) downstream. Resolved by the B1 repair which replaces atoi with pg_strtoint32.

Verification Summary

findingseverityverification_statusmethod
B1BLOCKERverifiedstatic-check (compile type-probe)
M1MAJORverifiedstatic-check
m1MINORverifiedstatic-check
m2MINORverifiedstatic-check
m5MINORverifiedstatic-check
n-atoiNITverifiedstatic-check

All findings verified. No findings refuted. No cannot-verify findings.

Repair Validation Summary

findingrepair patchvalidationnotes
B1788f62db...partial (apply-check, diff-check, compile)compile type-probe: original fails with 3 errors, repaired compiles clean
M189b7dfaa...partial (apply-check, diff-check, compile)combined B1+M1; new roundtrip fn compiles
m135b08c19...partial (apply-check, diff-check, static-check)pfree added on both paths
m212932795...partial (apply-check, diff-check, static-check)comment-only fix
m5094c504a...partial (apply-check, diff-check, static-check)qual=clauses
n-atoisubsumed by B1partial (compile)atoi→pg_strtoint32 in B1 patch

All candidate patches apply cleanly to copies of the staged files (dry-run and apply exit 0). Compile type-probes pass for B1/M1/n-atoi. Static inspection confirms the m1/m2/m5 fixes. No full make check was run: no meson/ninja build tree or running PostgreSQL server is available in this environment.

Security Summary

No PG-specific security vulnerabilities found. The module is test-only, correctly gated behind shared_preload_libraries startup-only load and default superuser-only C-extension install. No SECURITY DEFINER/dynamic SQL/file/role surface. The CustomScan does not bypass qual/ACL evaluation. One NIT (atoi robustness, non-security, test-scoped) resolved by the B1 repair.

Test-Gap Summary

The module's stated purpose is to "test correctness of extensible node and custom scan registration functions." Registration/lookup paths (GetExtensibleNodeMethods, GetCustomScanMethods) and the end-to-end CustomScan execution path are well covered. However, the four ExtensibleNodeMethods serialization/copy/equal callbacks (nodeOut, nodeRead, nodeCopy, nodeEqual) are registered but never invoked by the SQL (M1). The M1 repair adds a round-trip test exercising all four.

pgsql-hackers Thread Ledger

  1. 2026-03-31 — author: initial submission
  2. 2026-07-28 — reviewer: review (hard-coded slotOps; unused args; no tests for

nodeCopy/nodeEqual/nodeOut/nodeRead)

  1. 2026-07-30 — author: corrected patch
  2. 2026-08-05 — reviewer: "looks good to me"
  3. 2026-08-05 — author: "Thanks; fixed"

(B1 postdates the thread via core API drift).

Changed-Code Coverage

module. No core backend implementation file is changed; the new C file is test infrastructure that is itself the subject of review, not production implementation requiring coverage gating. The module cannot be built in this environment due to the verified B1 compile blocker and no meson/ninja build tree is available, so a fresh-instrumented coverage epoch cannot be produced. Per the harness, non-instrumentable-only / test-infrastructure changes use coverage_requirement.status=not-applicable.

module, extension SQL, control, conf, regression SQL/expected, build files). None are production implementation requiring coverage measurement.

(make check / meson regress) plus the M1 round-trip additions (SELECT test_roundtrip_extensible_node(2) / (42)) form the executable test set. No running server was available to execute them in this environment.

Verified-Clean Section

No code paths were found clean of issues beyond the findings above. The registration/lookup API usage (RegisterExtensibleNodeMethods, RegisterCustomScanMethods, GetExtensibleNodeMethods, GetCustomScanMethods), the table_beginscan/table_scan_getnextslot usage, the CustomScanState.slotOps assignment, the newNode usage, the set_rel_pathlist_hook chaining, and the process_shared_preload_libraries_in_progress gate are all correct.

Residual Risk

verified by compile type-probe.

repair is proposal-only (not applied to the read-only worktree).

before commit (do not overwrite expected output without a passing run).

Provenance / Model Routes

thread-reconciler (coordinator).