pgsql: Add relallfrozen to pg_dump statistics.

2025-03-30 Thread Jeff Davis
Add relallfrozen to pg_dump statistics. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=descuf3dvhasadvduvrmb-5go0mhmo5u9nzgv6i7u...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4694aedf63bf5b5d91f766cb6d6d6d14a9e4434b Modified File

pgsql: bufmgr: Use AIO in StartReadBuffers()

2025-03-30 Thread Andres Freund
bufmgr: Use AIO in StartReadBuffers() This finally introduces the first actual use of AIO. StartReadBuffers() now uses the AIO routines to issue IO. As the implementation of StartReadBuffers() is also used by the functions for reading individual blocks (StartReadBuffer() and through that ReadBuff

pgsql: aio: Basic read_stream adjustments for real AIO

2025-03-30 Thread Andres Freund
aio: Basic read_stream adjustments for real AIO Adapt the read stream logic for real AIO: - If AIO is enabled, we shouldn't issue advice, but if it isn't, we should continue issuing advice - AIO benefits from reading ahead with direct IO - If effective_io_concurrency=0, pass READ_BUFFERS_SYNCHRO

pgsql: Enable IO concurrency on all systems

2025-03-30 Thread Andres Freund
Enable IO concurrency on all systems Previously effective_io_concurrency and maintenance_io_concurrency could not be set above 0 on machines without fadvise support. AIO enables IO concurrency without such support, via io_method=worker. Currently only subsystems using the read stream API will tak

pgsql: read_stream: Introduce and use optional batchmode support

2025-03-30 Thread Andres Freund
read_stream: Introduce and use optional batchmode support Submitting IO in larger batches can be more efficient than doing so one-by-one, particularly for many small reads. It does, however, require the ReadStreamBlockNumberCB callback to abide by the restrictions of AIO batching (c.f. pgaio_enter

pgsql: bufmgr: Implement AIO read support

2025-03-30 Thread Andres Freund
bufmgr: Implement AIO read support This commit implements the infrastructure to perform asynchronous reads into the buffer pool. To do so, it: - Adds readv AIO callbacks for shared and local buffers It may be worth calling out that shared buffer completions may be run in a different backend

pgsql: Let caller of PageIsVerified() control ignore_checksum_failure

2025-03-30 Thread Andres Freund
Let caller of PageIsVerified() control ignore_checksum_failure For AIO the completion of a read into shared buffers (i.e. verifying the page including the checksum, updating the BufferDesc to reflect the IO) can happen in a different backend than the backend that started the IO. As ignore_checksum

pgsql: aio: Add WARNING result status

2025-03-30 Thread Andres Freund
aio: Add WARNING result status If an IO succeeds, but issues a warning, e.g. due to a page verification failure with zero_damaged_pages, we want to issue that warning in the context of the issuer of the IO, not the process that executes the completion (always the case for worker). It's already po

pgsql: pgstat: Allow checksum errors to be reported in critical section

2025-03-30 Thread Andres Freund
pgstat: Allow checksum errors to be reported in critical sections For AIO we execute completion callbacks in critical sections (to ensure that AIO can in the future be used for WAL, which in turn requires that we can call completion callbacks in critical sections, to get the resources for WAL io).

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-30 Thread Jeff Davis
On Sun, 2025-03-30 at 07:03 +0900, Michael Paquier wrote: > Thanks for the report.  It would be possible to switch to a second > approach here, where we use pg_free() if we don't have a > locale->db_locale to make sure that the memory is freed in its > correct > context, like in the attached.  What

pgsql: Remove incidental md5() function use from test

2025-03-30 Thread Tomas Vondra
Remove incidental md5() function use from test Replace md5() with sha256() in tests introduced in 14ffaece0fb5, to allow test to pass in OpenSSL FIPS mode. Reported-by: Tom Lane Discussion: https://postgr.es/m/3518736.1743307...@sss.pgh.pa.us Branch -- master Details --- https://git.po