Re: O(n) tasks cause lengthy startups and checkpoints

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: O(n) tasks cause lengthy startups and checkpoints
Date: 2022-01-03 06:59:04
Message-ID: CAAJ_b97ROyxBFNOyBXw=MUp=9C8PHiGsoKymipJSbFe5FZh6uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 3, 2022 at 2:56 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Hi,
>
> On 2021-12-14 20:23:57 +0000, Bossart, Nathan wrote:
> > As promised, here is v2. This patch set includes handling for all
> > four tasks noted upthread. I'd still consider this a work-in-
> > progress, as I've done minimal testing. At the very least, it should
> > demonstrate what an auxiliary process approach might look like.
>
> This generates a compiler warning:
> https://cirrus-ci.com/task/5740581082103808?logs=mingw_cross_warning#L378
>

Somehow, I am not getting these compiler warnings on the latest master
head (69872d0bbe6).

Here are the few minor comments for the v2 version, I thought would help:

+ * Copyright (c) 2021, PostgreSQL Global Development Group

Time to change the year :)
--

+
+ /* These operations are really just a minimal subset of
+ * AbortTransaction(). We don't have very many resources to worry
+ * about.
+ */

Incorrect formatting, the first line should be empty in the multiline
code comment.
--

+ XLogRecPtr logical_rewrite_mappings_cutoff; /* can remove
older mappings */
+ XLogRecPtr logical_rewrite_mappings_cutoff_set;

Look like logical_rewrite_mappings_cutoff gets to set only once and
never get reset, if it is true then I think that variable can be
skipped completely and set the initial logical_rewrite_mappings_cutoff
to InvalidXLogRecPtr, that will do the needful.
--

Regards,
Amul

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2022-01-03 07:17:44 Re: Schema variables - new implementation for Postgres 15
Previous Message Julien Rouhaud 2022-01-03 06:47:22 Use MaxLockMode in lock methods initialization