Re: AIO v2.4 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: AIO v2.4
Date
Msg-id k73s2agaddcyxzhxuyorf4fbbk4qkt4rpzdb2snaaicp3vamg6@tlz7drrab7lw
Whole thread Raw
In response to Re: AIO v2.4  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

On 2025-02-19 14:10:44 -0500, Andres Freund wrote:
> I'm planning to push the first two commits soon, I think they're ok on their
> own, even if nothing else were to go in.

I did that for the lwlock patch.

But I think I might not do the same for the "Ensure a resowner exists for all
paths that may perform AIO" patch. The paths for which we are missing
resowners are concerned WAL writes - but it'll be a while before we get
AIO WAL writes.

It'd be fairly harmless to do this change before, but I found the justifying
code comments hard to rephrase. E.g.:

--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -361,8 +361,15 @@ BootstrapModeMain(int argc, char *argv[], bool check_only)
     BaseInit();
 
     bootstrap_signals();
+
+    /* need a resowner for IO during BootStrapXLOG() */
+    CreateAuxProcessResourceOwner();
+
     BootStrapXLOG(bootstrap_data_checksum_version);
 
+    ReleaseAuxProcessResources(true);
+    CurrentResourceOwner = NULL;
+
     /*
      * To ensure that src/common/link-canary.c is linked into the backend, we
      * must call it from somewhere.  Here is as good as anywhere.

Given that there's no use of resowners inside BootStrapXLOG() today and not
for the next months it seems confusing?


Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Flaky 003_start_stop.pl test
Next
From: Bertrand Drouvot
Date:
Subject: Re: Remove wal_[sync|write][_time] from pg_stat_wal and track_wal_io_timing