From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
Cc: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Andy Fan <zhihuifan1213(at)163(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: pgbench error: (setshell) of script 0; execution of meta-command failed |
Date: | 2025-01-13 22:51:54 |
Message-ID: | 570943.1736808714@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> On Sat, Jan 11, 2025 at 02:04:13PM -0500, Tom Lane wrote:
>> What I propose doing in the released branches is what's shown in
>> the attached patch for v17: rename port/pqsignal.c's function to
>> pqsignal_fe in frontend, but leave it as pqsignal in the backend.
>> Leaving it as pqsignal in the backend preserves ABI for extension
>> modules, at the cost that it's not entirely clear which pqsignal
>> an extension that's also linked with libpq will get. But that
>> hazard affects none of our code, and it existed already for any
>> third-party extensions that call pqsignal. In principle using
>> "pqsignal_fe" in frontend creates an ABI hazard for outside users of
>> libpgport.a. But I think it's not really a problem, because we don't
>> support that as a shared library. As long as people build with
>> headers and .a files from the same minor release, they'll be OK.
> I don't have any concrete reasons to think you are wrong about this, but it
> does feel somewhat risky to me. It might be worth testing it with a couple
> of third-party projects that use the frontend version of pqsignal().
> codesearch.debian.net shows a couple that may be doing so [0] [1] [2].
It's fair to worry about this, but I don't think my testing that would
prove a lot. AFAICS, whether somebody runs into trouble would depend
on many factors like their specific build process and what versions of
which packages they have installed.
In any case, I think we have a very limited amount of wiggle room.
We definitely cannot change libpq's ABI without provoking howls of
anguish.
I have been wondering whether it would help to add something like
this at the end of port/pqsignal.c in the back branches:
#ifdef FRONTEND
#undef pqsignal
/* ABI-compatibility wrapper */
pqsigfunc
pqsignal(int signo, pqsigfunc func)
{
return pqsignal_fe(signo, func);
}
#endif
(plus or minus an extern or so, but you get the idea). The point of
this is that compiling against old headers and then linking against
newer libpgport.a would still work. It does nothing however for the
reverse scenario of compiling against new headers and then linking
against old libpgport.a. So I haven't persuaded myself that it's
worth the trouble -- but I'm happy to include it if others think
it would help.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Sami Imseih | 2025-01-13 23:17:11 | Re: New GUC autovacuum_max_threshold ? |
Previous Message | Alena Rybakina | 2025-01-13 22:37:17 | Re: Eagerly scan all-visible pages to amortize aggressive vacuum |