Re: Add test of pg_prewarm extenion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dong Wook Lee <sh95119(at)gmail(dot)com>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add test of pg_prewarm extenion
Date: 2022-08-01 22:09:57
Message-ID: 2183182.1659391797@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dong Wook Lee <sh95119(at)gmail(dot)com> writes:
>>> Couldn't you use $node->wait_for_log() instead?

> After trimming the code a little more, I sent the patch again.

This is much better, but still has some issues:

* The prefetch test might as well not be there, because
check_pg_config("#USE_PREFETCH 1") will never succeed: there is no
such string in pg_config.h. I don't actually see any good
(future-proof) way to determine whether USE_PREFETCH is enabled from
the available configuration data. After some thought I concluded we
could just try the function and accept either success or "prefetch is
not supported by this build".

* The script had no actual tests, so far as Test::More is concerned.
I'm not sure that that causes any real problems, but I reformulated
the pg_prewarm() tests to verify that a sane-looking result is
returned.

* I also added a test of autoprewarm_dump_now(), just to get the
line coverage count over the magic 75% figure.

* You left out a .gitignore file.

I made some other cosmetic changes (mostly, running it through
pgperltidy) and pushed it. Thanks for the patch!

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-08-01 22:13:59 Re: using file cloning in create database / initdb
Previous Message Jacob Champion 2022-08-01 22:03:19 Re: Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?