Skip to content

Fix INJECTION_POINT() macro arity mismatch on PG17 - #565

Merged
mason-sharp merged 1 commit into
mainfrom
spoc-647
Aug 12, 2026
Merged

Fix INJECTION_POINT() macro arity mismatch on PG17#565
mason-sharp merged 1 commit into
mainfrom
spoc-647

Conversation

@danolivo

@danolivo danolivo commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

spock_injection.h always called INJECTION_POINT() with two arguments (name, arg), the PG18+ signature. PG17 defines it with a single argument, so building spock with USE_INJECTION_POINTS against a PG17 core failed to compile. Gate the call on PG_VERSION_NUM so each core gets the arity it actually expects.

Also compile spockbench.yml's per-PR Docker build with --enable-injection-points (new ENABLE_INJECTION_POINTS Dockerfile build-arg) so this path is exercised on every PR instead of relying on SPOCK_RANDOM_DELAYS, which takes precedence in the same header and had been masking it.

spock_injection.h always called INJECTION_POINT() with two arguments
(name, arg), the PG18+ signature. PG17 defines it with a single
argument, so building spock with USE_INJECTION_POINTS against a PG17
core failed to compile. Gate the call on PG_VERSION_NUM so each core
gets the arity it actually expects.

Also compile spockbench.yml's per-PR Docker build with
--enable-injection-points (new ENABLE_INJECTION_POINTS Dockerfile
build-arg) so this path is exercised on every PR instead of relying on
SPOCK_RANDOM_DELAYS, which takes precedence in the same header and had
been masking it.
@danolivo danolivo self-assigned this Aug 6, 2026
@danolivo danolivo added the bug Something isn't working label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Docker build now enables PostgreSQL injection-point compilation. SPOCK_WORKER_DELAY() selects the PostgreSQL-version-compatible INJECTION_POINT signature.

Changes

Injection-point support

Layer / File(s) Summary
Enable injection-point compilation
.github/workflows/spockbench.yml, tests/docker/Dockerfile-step-1.el9
The workflow passes ENABLE_INJECTION_POINTS=1. The Dockerfile adds --enable-injection-points when the argument is non-empty.
Adapt worker-delay macro to PostgreSQL versions
include/spock_injection.h
SPOCK_WORKER_DELAY() uses the two-argument INJECTION_POINT form for PostgreSQL 18 and newer, and the one-argument form for older versions.

Poem

I’m a rabbit with injection points bright,
Building coverage through the night.
PostgreSQL versions hop in line,
Each gets the macro form that fits just fine.
Random delays stay out of sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary fix for the PostgreSQL 17 INJECTION_POINT() macro arity mismatch.
Description check ✅ Passed The description accurately explains the macro fix and the Docker build changes that test injection-point support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spoc-647

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/spockbench.yml:
- Line 58: Update the spockbench workflow’s ENABLE_INJECTION_POINTS build
argument so it is only passed for PostgreSQL versions that support or patch
injection points, excluding PostgreSQL 15 and 16 unless their patch sets are
extended accordingly; preserve the existing matrix builds for unsupported
versions without this argument.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 678ff2ca-7ef8-48d9-aad9-fab5690e94db

📥 Commits

Reviewing files that changed from the base of the PR and between 9141b0a and 6511439.

📒 Files selected for processing (3)
  • .github/workflows/spockbench.yml
  • include/spock_injection.h
  • tests/docker/Dockerfile-step-1.el9

Comment thread .github/workflows/spockbench.yml
@mason-sharp
mason-sharp merged commit 0100e70 into main Aug 12, 2026
18 checks passed
@mason-sharp
mason-sharp deleted the spoc-647 branch August 12, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants