From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Chao Li <li.evan.chao@gmail.com>
To: Сергей Шиндерук <s.shinderuk@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Typos in smgr.c
Date: Thu, 19 Nov 2026 14:52:32 +0200
Message-ID: <a87f76c7-e5ea-4e22-b297-67316c39b10f@iki.fi> (raw)
In-Reply-To: <C333CC74-A773-4995-B873-51720A1AF37A@gmail.com>
References: <A96F1990-57F8-4566-B55D-43D6087EE313@postgrespro.ru>
<C333CC74-A773-4995-B873-51720A1AF37A@gmail.com>
On 29/07/2026 10:37, Chao Li wrote:
>> On Jul 29, 2026, at 15:21, Сергей Шиндерук <s.shinderuk@postgrespro.ru> wrote:
>>
>> Hello,
>>
>> while reading the code I spotted a couple of typos in smgr.c. Please see attached.
>>
>> Looks like PgAioTargetData.smgr.skip_fsync is not used anywhere.
>>
>> Best regards,
>> Sergey Shinderuk
>> https://postgrespro.com/
>>
>> <typos-in-smgr.diff>
>
> 1.
> ```
> - * If more than one block is intended to be read, callers need to use
> + * If more than one block is intended to be written, callers need to use
> ```
>
> Yep, this seems like a copy-pasto.
>
> 2.
> ```
> @@ -1053,7 +1053,7 @@ pgaio_io_set_target_smgr(PgAioHandle *ioh,
> sd->smgr.nblocks = nblocks;
> sd->smgr.is_temp = SmgrIsTemp(smgr);
> /* Temp relations should never be fsync'd */
> - sd->smgr.skip_fsync = skip_fsync && !SmgrIsTemp(smgr);
> + sd->smgr.skip_fsync = skip_fsync || SmgrIsTemp(smgr);
> ```
>
> This is actually a bug fix. The current code incorrectly sets skip_fsync to false for every temporary relation, but temporary relations should not be fsynced.
Yep, committed.
> Maybe worth adding a test under src/test/modules/test_aio.
It's a bit hard to come up with a sensible test because "skip_fsync" is
currently unused.
- Heikki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: hlinnaka@iki.fi, li.evan.chao@gmail.com, s.shinderuk@postgrespro.ru
Subject: Re: Typos in smgr.c
In-Reply-To: <a87f76c7-e5ea-4e22-b297-67316c39b10f@iki.fi>
References: <A96F1990-57F8-4566-B55D-43D6087EE313@postgrespro.ru> <C333CC74-A773-4995-B873-51720A1AF37A@gmail.com> <a87f76c7-e5ea-4e22-b297-67316c39b10f@iki.fi>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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