Repository navigation
Gate the two changes from #2 that broke WarehousePG 6 and 7 - #5
Conversation
#2 adapted pljava-so for PG19 and got WHPG19 from a hard build failure to 7/7, but left two changes ungated. Both were justified from upstream PostgreSQL history, and both justifications are right about upstream - except upstream version numbers do not map onto WarehousePG lines. WarehousePG 7 is PG12 and WarehousePG 6 is PG9.4, both older than the reasoning assumed. TupleTable.c: tts->alloced - tts->free became tts->numvals, on the grounds that numvals predates the PG12 floor. It does not - numvals arrives in PostgreSQL 13 ("Further adjust SPITupleTable to provide a public row-count field"), which also removed free and repurposed alloced as the private array length. PG9.4 and PG12 both still have the alloced/free pair, so the shared whpg branch stopped compiling on both older lines: error: SPITupleTable has no member named numvals; did you mean vals? Now selected on PG_VERSION_NUM >= 130000. SPI.c: the SPI_restore_connection() call was deleted from SPI_rollbackSavepoint as a documented no-op since PostgreSQL 10. That is true from PG10 on, which is why it is invisible on WarehousePG 7 and WHPG19 - PG12 has it as #define SPI_restore_connection() ((void) 0). WarehousePG 6 is PG9.4, where it is still a real function that re-establishes the SPI connection after the subtransaction is aborted. Verified against the headers: extern void SPI_restore_connection(void) in WHPG_6X_STABLE and upstream through REL9_6_STABLE, the no-op macro from REL_10_STABLE, removed outright in REL_17_STABLE. Without it, javatest.testTransactionRecovery() on WHPG6 fails with SPI_ERROR_UNCONNECTED and every later statement aborts. This one compiles cleanly everywhere, so only a run against a WHPG6 cluster finds it. Now gated on PG_VERSION_NUM < 100000, so it is emitted only where it does real work and never on PG17+, where the symbol no longer exists.
24nishant
left a comment
There was a problem hiding this comment.
Verified : both upstream hashes are exact (1833f1a1c3b0, 75680c3d805e), the PG13 numvals/alloced/free account is right, and both gate boundaries land correctly — PG10–16 get no call since the no-op macro makes emitting it identical to not, PG17+ get none since the symbol is gone.
Two things not visible in the diff:
PG_VERSION_NUMdoes reachSPI.c, viapljava/SPI.h→PgObject.h→JNICalls.h→pljava.h. Worth confirming, since an undefined macro there would evaluate to 0 and emit the call on PG19 too.- Both
#elsebranches restore the pre-#2 code byte-identically, including keepingSPI_restore_connection()outside theifblock.
Also spot-checked the other 15 files #2 touched — object_aclcheck and funcname were already gated, bits8→uint8 is a typedef no-op, procsignal_sigusr1_handler is in 9.4. So these two are the only ungated ones, which the green package: + smoke: backs up.
One question on sequencing: the root cause is that nothing here builds the older lines, and the CI lane is deferred — so until it lands, the next break of this class is equally invisible. Any reason not to land it alongside this? Do we have ticket to track this?
Good catch on smoke: being skipped rather than failed when package: dies — worth fixing in the CI PR itself.
LGTM.
#5 landed as a squash, so this branch was not an ancestor of whpg and its copy of TupleTable.c would have reverted the comment that merged - the narrower "WarehousePG 7 is PG12" wording, rather than naming both older lines. Only a comment, but it re-narrows exactly the misconception that caused the WHPG6 break, so the conflict is resolved to whpg on both gate files. What is left here is the CI work and the installation fixes; SPI.c and TupleTable.c are byte-identical to whpg.
Fixes only what #2 broke. Nothing else — the CI lane, the WHPG19 conf-install
defect and the upstream-sync assessment follow in a second PR.
The problem
#2 adapted
pljava-sofor PG19 and got WHPG19 from a hard build failure to7/7, which it did. But two changes went in ungated, and the shared
whpgbranch stopped working on both older server lines from that merge
(2026-07-29) until now. Nothing in this repo builds it on any line, so there
was no signal.
Both changes were justified from upstream PostgreSQL history, and both
justifications are correct about upstream. The trap is that upstream version
numbers do not map onto WarehousePG's lines — WarehousePG 7 is PG12 and
WarehousePG 6 is PG9.4, both older than the reasoning assumed.
1.
SPITupleTable.numvals— build failure on WHPG7 and WHPG6tts->alloced - tts->freebecametts->numvals, on the grounds thatnumvals"predates pljava's PG12 floor". It does not: it arrives in PostgreSQL 13
(upstream "Further adjust SPITupleTable to provide a public row-count field"),
which also removed
freeand repurposedallocedas the private array length.numvalsallocedfreeNow selected on
PG_VERSION_NUM >= 130000.2.
SPI_restore_connection()— WHPG6 broken at run timeThe call was deleted from
SPI_rollbackSavepointas "a documented no-op sincePostgreSQL 10". True from PG10 on, which is exactly why it is invisible on
WHPG7 and WHPG19 — PG12 has it as
#define SPI_restore_connection() ((void) 0).WHPG6 is PG9.4, where it is still a real function that re-establishes the SPI
connection after the subtransaction is aborted.
Verified against the headers rather than assumed:
SPI_restore_connectionwarehouse-pg@WHPG_6X_STABLEextern void SPI_restore_connection(void);— real functionREL9_6_STABLEREL_10_STABLE…REL_16_STABLE#define … ((void) 0)REL_17_STABLEWithout it,
javatest.testTransactionRecovery()on WHPG6 fails and takes therest of the test with it:
Now gated
PG_VERSION_NUM < 100000, so it is emitted only where it does realwork and never on PG17+, where the symbol no longer exists.
This one compiles cleanly on every line. Only a run against a real WHPG6
cluster finds it — which is why it survived a header-level audit of #2 that
caught the
numvalsbreak.Evidence
whpg-extensions-packaging, el9/amd64,cloudsmith-upload=false. Note thatsmoke:is skipped, not failed, whenpackage:dies — so the base branchreads as green jobs plus skips while no test ever ran.
package:smoke:whpg(base)numvalswhpg(base)numvalsThe same two fixes already passed both lines as part of the combined branch —
WHPG7 34950265220
and WHPG6 34950261266,
package:andsmoke:green on both. The runs above re-confirm them inisolation —
package:andsmoke:green on both lines.WHPG19 is not a packaging target, so it was checked locally against
/usr/local/whpg/bin/pg_config(PG19beta1, GP 19.0.0) on a 3-segment cluster:7/7, no
regression.diffs— i.e. these gates do not regress the line #2was written for.
Scope
2 files, +25/−4. Deliberately excluded, to follow separately:
invisible for two months);
Makefileinstallconfsgating onGP_MAJORVERSION == 7, which means30-pljava.confis never installed on WHPG19 and is absent from the WHPG19gppkg payload;
gpdb/packaging/Makefileinstance of the same== 7bug;floor()/rint()used without<math.h>(pre-existing; GCC 14 and C23reject it);
product sign-off.
Supersedes #3 and #4, both closed in favour of this split.