public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: Bertrand Drouvot <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Tighten asserts on ParallelWorkerNumber a little bit
Date: Sat, 14 Mar 2026 15:53:21 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On 3/13/26 11:53, Bertrand Drouvot wrote:
> ...
>
>> So AFAICS the assert(s) should be
>>
>>   Assert(ParallelWorkerNumber < node->shared_info->num_workers);
> 
> I think that you're right. It looks like the first one has been introduced
> by bf11e7ee2e3 and then the others are probably copy/paste.
> 
>> I don't think we had issues with this not catching a bug. But it may be
>> a bit misleading, so worth fixing and (probably) backpatching.
> 
> I do agree.
> 
> With that patch applied, the remaining one:
> 
> $ git grep "<=.*num_workers"
> src/backend/executor/nodeGatherMerge.c: Assert(nreaders <= castNode(GatherMerge, gm_state->ps.plan)->num_workers);
> 
> does not need to be fixed, so I think that your patch does not miss any and
> LGTM.
> 

Thanks. Pushed and backpatched.

-- 
Tomas Vondra






view thread (2+ messages)

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Tighten asserts on ParallelWorkerNumber a little bit
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox