Skip to content

fix: set output_plugin_libraries for gated PG minor versions - #452

Merged
tsivaprasad merged 2 commits into
mainfrom
PLAT-721-set-output-plugin-libraries-for-newer-pg-minor-versions-in-control-plane
Aug 12, 2026
Merged

fix: set output_plugin_libraries for gated PG minor versions#452
tsivaprasad merged 2 commits into
mainfrom
PLAT-721-set-output-plugin-libraries-for-newer-pg-minor-versions-in-control-plane

Conversation

@tsivaprasad

@tsivaprasad tsivaprasad commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the version manifest to support Spock 5.0.11 and configures output_plugin_libraries to include spock_output for PostgreSQL versions 16.15+, 17.11+, and 18.5+, where it is now required for replication slot creation.

Changes

  • Updated postgres.DefaultGUCs() to accept a *ds.PgEdgeVersion and automatically include output_plugin_libraries = "pgoutput, test_decoding, spock_output" for PostgreSQL 16.15+, 17.11+, 18.5+, and newer major versions.
  • Added a PgEdgeVersion field to PatroniConfigGenerator, initialized from the instance spec in NewPatroniConfigGenerator and propagated to DefaultGUCs() through parameters().
  • Preserved existing override behavior—user-defined postgresql_conf.output_plugin_libraries values continue to take precedence since spec parameters are merged last.
  • Updated the embedded version manifest to reference the published Spock 5.0.11 images for the 16.14, 17.10, and 18.4 entries.

Testing

  • go test ./server/internal/postgres/... ./server/internal/orchestrator/common/... ./server/internal/orchestrator/swarm/...
  • Added table-driven unit tests in gucs_test.go covering both sides of each version gate (16.14/16.15, 17.10/17.11, 18.4/18.5, a future major, and a nil version).
  • Manually verified end-to-end in the local dev environment using a temporary local manifest override (not part of this diff) that declared a fake 18.5 version pointing at the real 18.4-spock5.0.11 image, since no genuinely patched PG image exists yet:
    • Confirmed patroni.yaml's generated parameters include output_plugin_libraries: pgoutput, test_decoding, spock_output for a database declared as postgres_version: 18.5.
    • Confirmed a postgresql_conf.output_plugin_libraries override in the database spec is honored instead of the default.
    • Could not verify actual Spock replication behavior against a genuinely patched Postgres binary, since pgEdge hasn't published 16.15/17.11/18.5 images yet.

Checklist

  • Tests added or updated

PLAT-721

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2918d279-d7a7-4c0d-b017-a5bd5a7218d0

📥 Commits

Reviewing files that changed from the base of the PR and between 18fe41a and efad536.

📒 Files selected for processing (6)
  • changes/unreleased/Added-20260812-123758.yaml
  • changes/unreleased/Fixed-20260812-123144.yaml
  • server/internal/orchestrator/common/patroni_config_generator.go
  • server/internal/orchestrator/swarm/version-manifest.json
  • server/internal/postgres/gucs.go
  • server/internal/postgres/gucs_test.go

📝 Walkthrough

Walkthrough

The change makes default PostgreSQL GUCs version-aware. Patroni configuration passes the PostgreSQL version to DefaultGUCs. Spock image references and release notes now document Spock 5.0.11 and version-specific spock_output support.

Changes

Version-aware PostgreSQL defaults

Layer / File(s) Summary
Version-gated output plugin configuration
server/internal/postgres/gucs.go, server/internal/postgres/gucs_test.go
DefaultGUCs adds output_plugin_libraries for configured PostgreSQL version thresholds. Tests cover missing versions, boundary versions, older versions, and future majors.
Version propagation into Patroni configuration
server/internal/orchestrator/common/patroni_config_generator.go
PatroniConfigGenerator stores the instance PgEdgeVersion and passes it to postgres.DefaultGUCs.
Spock image and release metadata alignment
server/internal/orchestrator/swarm/version-manifest.json, changes/unreleased/*.yaml
PostgreSQL 16.14, 17.10, and 18.4 image references use Spock 5.0.11. Release notes document Spock support and spock_output enablement.

Poem

A rabbit checks the version gate,
Plugins hop in when dates are right.
Spock images rise to 5.0.11,
Replication slots return to light.
pg_edge_version guides the way,
And carrots mark this release day. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the version-gated output_plugin_libraries fix and follows Conventional Commits format.
Description check ✅ Passed The description covers the summary, changes, testing, linked issue, changelog updates, and known testing limitations.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PLAT-721-set-output-plugin-libraries-for-newer-pg-minor-versions-in-control-plane

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 complexity · -1 duplication

Metric Results
Complexity 0
Duplication -1

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.

@jason-lynch jason-lynch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect! Thank you for doing this.

@tsivaprasad
tsivaprasad merged commit 70930c4 into main Aug 12, 2026
5 checks passed
@tsivaprasad
tsivaprasad deleted the PLAT-721-set-output-plugin-libraries-for-newer-pg-minor-versions-in-control-plane branch August 12, 2026 14:42
tsivaprasad added a commit that referenced this pull request Aug 14, 2026
* fix: set output_plugin_libraries for gated PG minor versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants