pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedsrc/test/recovery regression failure on bionic
8+ messages / 4 participants
[nested] [flat]
* src/test/recovery regression failure on bionic
@ 2020-01-08 14:38 Christoph Berg <myon@debian.org>
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Berg @ 2020-01-08 14:38 UTC (permalink / raw)
To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andres Freund <andres@anarazel.de>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Re: Amit Kapila 2020-01-08 <CAA4eK1KtQDU=RTAPi6id6Nvv1HkKrpDp_ZZ_uHL1XQ0cjT2_eg@mail.gmail.com>
> It looks like this failure is more of what we are getting on
> "sidewinder" where it failed because of "insufficient file descriptors
> available to start server process". Can you check in the log
> (probably in 006_logical_decoding_master.log) if this is the same you
> are getting or something else.
I can't reproduce it locally now, but it's still failing on the
buildd. Is there some setting to make it print the relevant .log
files?
(Fwiw, I can't see your error message in
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sidewinder&dt=2020-01-07%2022%3A45%3A24)
Christoph
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-08 15:04 Tom Lane <tgl@sss.pgh.pa.us>
parent: Christoph Berg <myon@debian.org>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2020-01-08 15:04 UTC (permalink / raw)
To: Christoph Berg <myon@debian.org>; +Cc: Amit Kapila <amit.kapila16@gmail.com>; Andres Freund <andres@anarazel.de>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Christoph Berg <myon@debian.org> writes:
> (Fwiw, I can't see your error message in
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sidewinder&dt=2020-01-07%2022%3A45%3A24)
sidewinder is currently broken due to an unrelated problem.
The case Amit is worried about is only manifesting on the
back branches, eg here:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sidewinder&dt=2020-01-02%2018%3A45%3A25
where we're getting postmaster start failures like this one:
2020-01-02 19:51:05.685 CET [24138:1] LOG: starting PostgreSQL 12.1 on x86_64-unknown-netbsd7.0, compiled by gcc (nb2 20150115) 4.8.4, 64-bit
2020-01-02 19:51:05.686 CET [24138:2] LOG: listening on Unix socket "/tmp/sxAcn7SAzt/.s.PGSQL.56110"
2020-01-02 19:51:05.687 CET [24138:3] FATAL: insufficient file descriptors available to start server process
2020-01-02 19:51:05.687 CET [24138:4] DETAIL: System allows 19, we need at least 20.
2020-01-02 19:51:05.687 CET [24138:5] LOG: database system is shut down
This would happen if anything is causing the postmaster to have
a few more open files than the test added by commit
d207038053837ae9365df2776371632387f6f655 is allowing for. It's
a test bug and nothing more.
Why sidewinder is not showing this in HEAD too is an interesting
question, but it isn't. However, it could be that on another
platform (ie bionic) the problem does manifest in HEAD.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-08 22:31 Tom Lane <tgl@sss.pgh.pa.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2020-01-08 22:31 UTC (permalink / raw)
To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Christoph Berg <myon@debian.org>; Andres Freund <andres@anarazel.de>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
I wrote:
> This would happen if anything is causing the postmaster to have
> a few more open files than the test added by commit
> d207038053837ae9365df2776371632387f6f655 is allowing for. It's
> a test bug and nothing more.
> Why sidewinder is not showing this in HEAD too is an interesting
> question, but it isn't. However, it could be that on another
> platform (ie bionic) the problem does manifest in HEAD.
I set up a NetBSD 7 installation locally, and while I have not
directly reproduced the failure, I believe I understand all the
components of it now.
(1) d20703805's test will clearly fall over if there are more than six
FDs open in the postmaster when set_max_safe_fds is called, because it
sets max_files_per_process = 26 while set_max_safe_fds requires at
least 20 usable FDs to be available.
(2) The postmaster's stdin/stdout/stderr will surely eat up three of
those.
(3) In HEAD, that's actually all the FDs there are normally, but in the
back branches there is one more (under the conditions of this test),
because in the back branches we open the postmaster's listen sockets
before we run set_max_safe_fds. (9a86f03b4 changed this.)
(4) NetBSD 7.0's cron leaves three extra open FDs in processes that
it spawns. I have not looked into why, but I have experimentally
observed this. For example, lsof on a "sleep" launched from cron
shows
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sleep 7824 tgl cwd VDIR 0,0 512 795201 /home/tgl
sleep 7824 tgl txt VREG 0,0 10431 1613152 /bin/sleep
sleep 7824 tgl txt VREG 0,0 1616564 22726 /lib/libc.so.12.193.1
sleep 7824 tgl txt VREG 0,0 55295 22747 /lib/libgcc_s.so.1.0
sleep 7824 tgl txt VREG 0,0 187183 22762 /lib/libm.so.0.11
sleep 7824 tgl txt VREG 0,0 92195 1499524 /libexec/ld.elf_so
sleep 7824 tgl 0r PIPE 0xfffffe803131eb58 16384
sleep 7824 tgl 1w PIPE 0xfffffe8007ec4a30 0 ->0xfffffe800cc0d2c0
sleep 7824 tgl 2w PIPE 0xfffffe8007ec4a30 0 ->0xfffffe800cc0d2c0
sleep 7824 tgl 7u unknown file system type: 0
sleep 7824 tgl 8u unknown file system type: 0
sleep 7824 tgl 9w PIPE 0xfffffe80036c4dc0 0
while of course "sleep" launched by hand has only 0/1/2 open.
We may conclude that when the regression tests are launched from cron,
as would be typical for a buildfarm animal, HEAD has exactly zero FDs
to spare in this test, while the back branches are one FD underwater
and fail. This matches the observed results from sidewinder.
It's not clear whether any of this info applies to Christoph's trouble
with bionic. If the extra FDs are an old cron bug, it could be that
bionic shares that bug --- but to explain failure on HEAD, you'd have to
posit four excess FDs not three. I'm not convinced that what Christoph
is seeing matches this anyway; he hasn't showed the telltale
"insufficient file descriptors" message, at least. Still, maybe
launched-by-cron vs launched-by-hand is a relevant point there.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-08 23:22 Andres Freund <andres@anarazel.de>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Andres Freund @ 2020-01-08 23:22 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Amit Kapila <amit.kapila16@gmail.com>; Christoph Berg <myon@debian.org>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Hi,
On 2020-01-08 17:31:06 -0500, Tom Lane wrote:
> (1) d20703805's test will clearly fall over if there are more than six
> FDs open in the postmaster when set_max_safe_fds is called, because it
> sets max_files_per_process = 26 while set_max_safe_fds requires at
> least 20 usable FDs to be available.
> (4) NetBSD 7.0's cron leaves three extra open FDs in processes that
> it spawns. I have not looked into why, but I have experimentally
> observed this. For example, lsof on a "sleep" launched from cron
> shows
>
> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
> sleep 7824 tgl cwd VDIR 0,0 512 795201 /home/tgl
> sleep 7824 tgl txt VREG 0,0 10431 1613152 /bin/sleep
> sleep 7824 tgl txt VREG 0,0 1616564 22726 /lib/libc.so.12.193.1
> sleep 7824 tgl txt VREG 0,0 55295 22747 /lib/libgcc_s.so.1.0
> sleep 7824 tgl txt VREG 0,0 187183 22762 /lib/libm.so.0.11
> sleep 7824 tgl txt VREG 0,0 92195 1499524 /libexec/ld.elf_so
> sleep 7824 tgl 0r PIPE 0xfffffe803131eb58 16384
> sleep 7824 tgl 1w PIPE 0xfffffe8007ec4a30 0 ->0xfffffe800cc0d2c0
> sleep 7824 tgl 2w PIPE 0xfffffe8007ec4a30 0 ->0xfffffe800cc0d2c0
> sleep 7824 tgl 7u unknown file system type: 0
> sleep 7824 tgl 8u unknown file system type: 0
> sleep 7824 tgl 9w PIPE 0xfffffe80036c4dc0 0
>
> while of course "sleep" launched by hand has only 0/1/2 open.
Is it worth having the test close superflous FDs? It'd not be hard to do
so via brute force (or even going through /proc/self/fd).
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-09 00:18 Tom Lane <tgl@sss.pgh.pa.us>
parent: Andres Freund <andres@anarazel.de>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2020-01-09 00:18 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: Amit Kapila <amit.kapila16@gmail.com>; Christoph Berg <myon@debian.org>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Andres Freund <andres@anarazel.de> writes:
> Is it worth having the test close superflous FDs? It'd not be hard to do
> so via brute force (or even going through /proc/self/fd).
No, it isn't, because d20703805's test is broken by design. There
are any number of reasons why there might be more than three-or-so
FDs open during postmaster start. Here are a few:
* It seems pretty likely that at least one of those FDs is
intentionally being left open by cron so it can detect death of
all child processes (like our postmaster death pipe). Forcibly
closing them will not necessarily have nice results. Other
execution environments might do similar tricks.
* On platforms where semaphores eat a FD apiece, we intentionally
open those before counting free FDs.
* We run process_shared_preload_libraries before counting free FDs,
too. If a loaded library intentionally leaves a FD open in the
postmaster, counting that against the limit also seems like a good
idea.
My opinion is still that we should just get rid of that test case.
The odds of it ever finding anything interesting seem too low to
justify the work that will be involved in (a) getting it to work
reliably today and then (b) keeping it working. Running on the
hairy edge of not having enough FDs doesn't seem like a use-case
that we want to spend a lot of time on, but we will be if that
test stays as it is. Example: if max_safe_fds is only 10, as
this test is trying to make it be, then maxAllocatedDescs won't
be allowed to exceed 5. Do you want to bet that no code paths
will reasonably exceed that limit? [1] What will we do about it
when we find one that does?
I also note that the test can only catch cases where we used
OpenTransientFile() in an inappropriate way. I think it's at
least as likely that somebody would carelessly use open()
directly, and then we have no chance of catching it till the
kernel complains about EMFILE.
Thinking about that some more, maybe the appropriate thing
to do is not to mess with max_files_per_process as such,
but to test with some artificial limit on maxAllocatedDescs.
We still won't catch direct use of open(), but that could test
for misuse of OpenTransientFile() with a lot less environment
dependence.
regards, tom lane
[1] Although I notice that the code coverage report shows we
never reach the enlargement step in reserveAllocatedDesc(),
which means that the set of tests we run today don't exercise
any such path. I'm somewhat surprised to see that we *do*
seem to exercise overrunning max_safe_fds, though, since
ReleaseLruFile() is reached. Maybe this test case is
responsible for that?
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-09 02:31 Amit Kapila <amit.kapila16@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Amit Kapila @ 2020-01-09 02:31 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; Christoph Berg <myon@debian.org>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
On Thu, Jan 9, 2020 at 5:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Andres Freund <andres@anarazel.de> writes:
> > Is it worth having the test close superflous FDs? It'd not be hard to do
> > so via brute force (or even going through /proc/self/fd).
>
> No, it isn't, because d20703805's test is broken by design. There
> are any number of reasons why there might be more than three-or-so
> FDs open during postmaster start. Here are a few:
>
> * It seems pretty likely that at least one of those FDs is
> intentionally being left open by cron so it can detect death of
> all child processes (like our postmaster death pipe). Forcibly
> closing them will not necessarily have nice results. Other
> execution environments might do similar tricks.
>
> * On platforms where semaphores eat a FD apiece, we intentionally
> open those before counting free FDs.
>
> * We run process_shared_preload_libraries before counting free FDs,
> too. If a loaded library intentionally leaves a FD open in the
> postmaster, counting that against the limit also seems like a good
> idea.
>
> My opinion is still that we should just get rid of that test case.
>
The point is that we know what is going wrong on sidewinder on back
branches. However, we still don't know what is going wrong with tern
and mandrill on v10 [1][2] where the log is:
2020-01-08 06:38:10.842 UTC [54001846:9] t/006_logical_decoding.pl
STATEMENT: SELECT data from pg_logical_slot_get_changes('test_slot',
NULL, NULL)
WHERE data LIKE '%INSERT%' ORDER BY lsn LIMIT 1;
2020-01-08 06:38:15.993 UTC [63898020:3] LOG: server process (PID
54001846) was terminated by signal 11
2020-01-08 06:38:15.993 UTC [63898020:4] DETAIL: Failed process was
running: SELECT data from pg_logical_slot_get_changes('test_slot',
NULL, NULL)
WHERE data LIKE '%INSERT%' ORDER BY lsn LIMIT 1;
2020-01-08 06:38:15.993 UTC [63898020:5] LOG: terminating any other
active server processes
Noah has tried to reproduce it [3] on that buildfarm machine by
running that test in a loop, but he couldn't reproduce it till now. He
is running the test now for a longer duration. Another point is that
the logic in v11 code is the same, but the same test is passing on
those machines, so I have a slight suspicion that there might be some
other problem in v10 which is uncovered by this test, but I am not
sure on this point.
Now, if we remove that test as per your suggestion, then we might not
be able to find out what is going wrong on those machines in v10?
[1] - https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=tern&dt=2020-01-08%2004%3A36%3A27
[2] - https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2020-01-08%2004%3A36%3A27
[3] - https://www.postgresql.org/message-id/20200104185148.GA2270238%40rfd.leadboat.com
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-15 20:40 Christoph Berg <myon@debian.org>
parent: Amit Kapila <amit.kapila16@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Berg @ 2020-01-15 20:40 UTC (permalink / raw)
To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Re: Amit Kapila 2020-01-09 <CAA4eK1Kq13BS2z1xOfTDcuSwzga+0NPzSWXgw3ygxX9tRk1rEg@mail.gmail.com>
> The point is that we know what is going wrong on sidewinder on back
> branches. However, we still don't know what is going wrong with tern
> and mandrill on v10 [1][2] where the log is:
Fwiw, the problem on bionic disappeared yesterday with the build
triggered by "Revert test added by commit d207038053".
Christoph
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: src/test/recovery regression failure on bionic
@ 2020-01-16 02:15 Amit Kapila <amit.kapila16@gmail.com>
parent: Christoph Berg <myon@debian.org>
0 siblings, 0 replies; 8+ messages in thread
From: Amit Kapila @ 2020-01-16 02:15 UTC (permalink / raw)
To: Christoph Berg <myon@debian.org>; Amit Kapila <amit.kapila16@gmail.com>; PostgreSQL Hackers <pgsql-hackers@postgresql.org>
On Thu, Jan 16, 2020 at 2:10 AM Christoph Berg <myon@debian.org> wrote:
>
> Re: Amit Kapila 2020-01-09 <CAA4eK1Kq13BS2z1xOfTDcuSwzga+0NPzSWXgw3ygxX9tRk1rEg@mail.gmail.com>
> > The point is that we know what is going wrong on sidewinder on back
> > branches. However, we still don't know what is going wrong with tern
> > and mandrill on v10 [1][2] where the log is:
>
> Fwiw, the problem on bionic disappeared yesterday with the build
> triggered by "Revert test added by commit d207038053".
>
Thanks for the update.
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2020-01-16 02:15 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 14:38 src/test/recovery regression failure on bionic Christoph Berg <myon@debian.org>
2020-01-08 15:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-01-08 22:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-01-08 23:22 ` Andres Freund <andres@anarazel.de>
2020-01-09 00:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-01-09 02:31 ` Amit Kapila <amit.kapila16@gmail.com>
2020-01-15 20:40 ` Christoph Berg <myon@debian.org>
2020-01-16 02:15 ` Amit Kapila <amit.kapila16@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox