PG19: build foundation (source-level compat, scaffold ruleutils_19.c, CI image bump)#8600
Closed
ihalatci wants to merge 6 commits into
Closed
PG19: build foundation (source-level compat, scaffold ruleutils_19.c, CI image bump)#8600ihalatci wants to merge 6 commits into
ihalatci wants to merge 6 commits into
Conversation
Phase 1 of PG19 enablement: source-level compatibility for PG19devel. Achieves a clean build (0 errors) on PG19 while keeping PG17 and PG18 builds green. Regression sanity and new-feature integration are out of scope for this phase. Highlights: - configure.ac / configure / pg_version_constants.h: accept PG19, add PG_VERSION_19 (and PG_VERSION_20 placeholder). - src/include/pg_version_compat.h: centralized PG19 source-compat shims (PageSetChecksumInplace, replorigin_session_origin, GetPublicationRelations, pg_plan_query/standard_planner/planner signatures, FuncnameGetCandidates, ShmemInitHash 4-arg form, ExecInitScanTupleSlot/table_beginscan flags, LWLock tranche, NamedLWLockTranche, ClusterStmt->RepackStmt typedef and tag, standard_conforming_strings helper, bits16/fmStringInfo, RepOriginId/InvalidRepOriginId, query_instr). - Distributed/columnar source updates for renamed/retyped APIs: PGPROC->links->waitLink, ClusterStmt->RepackStmt indirection, Instrumentation/NodeInstrumentation split, pgstat_report_vacuum PG19 signature, get_relation_info_hook gating, columnar PageSetChecksum shim. - shared_library_init.c: 128 KB shmem slack on PG19 to absorb cache-line alignment overhead now that ShmemInitHash allocates all hash elements upfront. - maintenanced.c: drop pre-existing double-count of hash size in ShmemInitStruct sizing. - ruleutils_19.c: scaffold copy of ruleutils_18.c with func_get_detail call updated for the new int *fgc_flags arg (semantic port deferred to Phase 2). - Header hygiene: add pg_version_compat.h / fmgr.h / storage/fd.h / tuplestore.h / lwlock / shmem includes where transitive includes no longer pull them in under PG19. - resource_lock.h: bump PG_MAJORVERSION_NUM static assert to <= 19. Validated: - PG19devel: 0 errors, exit=0; CREATE EXTENSION citus succeeds. - PG17.5 / PG18.3: 0 errors, exit=0 (regression guard).
Pulls in the test images built by citusdata/the-process#218: - PG16: 16.13 -> 16.14 - PG17: 17.9 -> 17.10 - PG18: 18.3 -> 18.4 - PG19: 19devel (new, source-built in the upstream image) Bumps image_suffix to -dev-e11d99c, updates sql_snapshot_pg_version to 18.4, and updates upgrade_pg_versions to 16.14-17.10-18.4. Adds pg19_version to the build matrix so PG19 source-level build is exercised by CI. PG19 is intentionally NOT added to test-citus / test-citus-failure / test-citus-cdc / upgrade jobs in this PR: the regression suite requires the upstream-derived ruleutils_19.c that lands in PR1b. Until then, only the build path is meaningful on PG19.
Make the full tree build clean under PG19 with CI's -Werror flags, without demoting any compiler flag. All changes are version-guarded behind PG_VERSION_NUM >= PG_VERSION_19 so PG17/18 behavior is unchanged: - old-style function definitions/declarations -> (void) - -Wimplicit-fallthrough=5: use pg_fallthrough (with PG<19 compat fallback) - TableAM callback signature changes (columnar_tableam.c, test/fake_am.c) - Instrumentation vs NodeInstrumentation API split - planner_hook gains ExplainState*; distributed_planner signature update - config_enum_lookup_by_value takes const struct config_generic * - log_min_messages is now a per-backend-type array - RTE_GRAPH_TABLE / OBJECT_PROPGRAPH new switch cases - RepOriginId/InvalidRepOriginId renames; guarded compat define - unused trancheName under no-op LWLockRegisterTranche
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## pg19-support #8600 +/- ##
================================================
- Coverage 88.75% 88.69% -0.07%
================================================
Files 288 288
Lines 64289 64350 +61
Branches 8090 8091 +1
================================================
+ Hits 57062 57075 +13
- Misses 4889 4936 +47
- Partials 2338 2339 +1 🚀 New features to boost your workflow:
|
ruleutils_19.c is a near-verbatim copy of PostgreSQL's ruleutils.c, like ruleutils_16/17/18.c which are all marked -citus-style. At 11943 lines it also exceeds uncrustify's internal line limit (SetOrigLine too big 10001), which aborted the Check C Style CI step. Exclude it from formatting to match its sibling files.
Bump upgrade_pg_versions to 16.14-17.10-18.4-19devel so the pgupgradetester image includes PG19 binaries (the suffixed image already ships it), and add 18->19 and 16->19 upgrade pairs to the check-pg-upgrade matrix. citus-upgrade stays on PG16/17 since older Citus releases do not support PG19.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIPTION: Add PG19 build support; extension compiles and loads.
First PR of the PG19 enablement series tracked in #8597. Achieves
source-level compatibility with PG19 (
pg19devel) and a cleanCREATE EXTENSION cituswhile keeping PG17 and PG18 builds green.Regression-test correctness and PG19 feature integration are tackled
in follow-up PRs against the
pg19-supportdevelopment branch.What changed
Source-level PG19 compat
configure.ac/configure/pg_version_constants.h: accept PG19,add
PG_VERSION_19(and aPG_VERSION_20placeholder).src/include/pg_version_compat.h: centralised PG19 source-compatshims (
PageSetChecksumInplace,replorigin_session_origin,GetPublicationRelations,pg_plan_query/standard_planner/plannersignatures,FuncnameGetCandidates,ShmemInitHash4-argform,
ExecInitScanTupleSlot/table_beginscanflags, LWLocktranche,
NamedLWLockTranche,ClusterStmt→RepackStmtindirection,
standard_conforming_stringshelper,bits16/fmStringInfo,RepOriginId/InvalidRepOriginId,query_instr).PGPROC->links->waitLink,ClusterStmtindirection,Instrumentation/NodeInstrumentationsplit,pgstat_report_vacuumPG19 signature,get_relation_info_hookgating, columnar
PageSetChecksumshim.pg_version_compat.h/fmgr.h/storage/fd.h/
tuplestore.h/ lwlock / shmem includes wherever transitiveincludes no longer pull them in under PG19.
resource_lock.h: bumpPG_MAJORVERSION_NUMstatic-assert ceilingto ≤ 19.
Compiler-warning (
-Werror) fixesstricter warnings (old-style
foo()→(void)prototypes,strict-prototype forward declarations,
-Wimplicit-fallthroughannotations, new
switcharms, etc.). No compiler-flagdemotion — the build stays on the same warning/error flags as
PG17/PG18; warnings are resolved at the source rather than silenced.
Shmem sizing
shared_library_init.c: add 128 KB of shmem slack on PG19 to absorbthe new cache-line alignment overhead now that
ShmemInitHashallocates all hash elements up-front. Heuristic — sized
empirically against current Citus shmem consumers; revisit if a
consumer is added.
maintenanced.c: drop a pre-existing double-count of hash size inShmemInitStructsizing. Only exposed because PG19's newShmemInitHashpre-allocates the buckets. Bundled here because thefix is required for the PG19 build to load; called out separately
so reviewers don't read it as scope creep.
Deparser (scaffold only)
ruleutils_19.c: scaffold only in this PR. Per the precedentset by PG17 compatibility: ruleutils #7725 (PG17) and Pg18 ruleutils adaptation #8010 (PG18), the deparser file lands in
its own PR (PR1b). PR1 ships the file as a clone of
ruleutils_18.cretargeted at the PG19 version guard so the binary links. Running
the regression suite against PR1 alone produces 18 failures in
check-multiand many more incheck-multi-mx— silentPG18-on-PG19 deparse corruption. PR1b imports a proper upstream PG19
ruleutils via 3-way merge and brings the suite to 191/191 + 68/69.
.gitattributes: excluderuleutils_19.cfrom citus-style(
-citus-style). The file is an upstream-derived clone (~12k lines)and exceeds the CI uncrustify (
citus_indent0.68.1) 10,000-linelimit, which otherwise aborts the style check.
CI
image_suffixin.github/workflows/build_and_test.ymlfrom-dev-fa732cbto-dev-e11d99cso CI pulls the test-image setthat includes PG19 bits. The same change bumps the PG minors to
16.14 / 17.10 / 18.4.
pg19_versionto the params block and wire it into the buildmatrix. PG19 (
19devel) is also wired into the pg-upgrade jobs:the
test-pg-upgradematrix gains18 → 19and16 → 19pairs andupgrade_pg_versionsbecomes16.14-17.10-18.4-19devel.test-citus,test-citus-failure,test-citus-cdc, or thetest-citus-upgradejob. The regression suite requires the upstream-derived
ruleutils_19.cthat lands in PR1b, and no released Citus supportsPG19 yet (so Citus-version upgrade testing on PG19 is not meaningful).
Until PR1b lands, only the build and pg-upgrade paths are meaningful
on PG19.
Validation
CREATE EXTENSION citussucceeds.subsequent PRs against
pg19-support.Non-goals / follow-ups
or any production workload on PG19 before PR1b lands.
multi_explain.cis touched here for theInstrumentation/NodeInstrumentationrename only. A separateTupleDescFinalizeruntime fix lands in PR2.
Refs: #8597