About forced dependencies on catversion.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: About forced dependencies on catversion.h
Date: 2017-05-12 21:15:27
Message-ID: 30154.1494623727@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

backend/access/transam/Makefile contains

# ensure that version checks in xlog.c get recompiled when catversion.h changes
xlog.o: xlog.c $(top_srcdir)/src/include/catalog/catversion.h

which, at the time it was added, was sufficient to ensure you could do
"make check" after bumping catversion and things would work, whether
or not you bother with --enable-depend.

It ain't sufficient anymore though. First off, pg_rewind.c also has
compiled-in knowledge of CATALOG_VERSION_NO. So if you try "make
check-world" after naively bumping catversion, the pg_rewind TAP tests
will blow up most spectacularly, because the backend will have been
rebuilt to use the new catversion while pg_rewind won't have.

I started this post with the intention of proposing that we add a
similar forced dependency for pg_rewind.o. However, grepping revealed
a much bigger hazard, which is that CATALOG_VERSION_NO also factors
into TABLESPACE_VERSION_DIRECTORY, and there are dependencies on that
in about eight different files. The scary thing there is that a naive
test run will appear to work as long as you didn't rebuild any of those
files; while if you caused a rebuild of just some of them, it's gonna
be a mess.

So what I now think is that we'd be better off removing the forced
dependency shown above. It's just encouraging people to take unsafe
shortcuts.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Jungwirth 2017-05-12 21:15:37 Patch to fix documentation about AFTER triggers
Previous Message Merlin Moncure 2017-05-12 20:52:40 Re: CTE inlining