From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
To: 'pgsql-hackers@lists.postgresql.org' <pgsql-hackers@lists.postgresql.org>
Subject: Re: Some codes refer slot()->{'slot_name'} but it is not defined
Date: Thu, 3 Apr 2025 18:21:44 +0900
Message-ID: <1fdfd020-a509-403c-bd8f-a04664aba148@oss.nttdata.com> (raw)
In-Reply-To: <OSCPR01MB149667EC4E738769CA80B7EA5F5AE2@OSCPR01MB14966.jpnprd01.prod.outlook.com>
References: <OSCPR01MB149667EC4E738769CA80B7EA5F5AE2@OSCPR01MB14966.jpnprd01.prod.outlook.com>
On 2025/04/03 12:15, Hayato Kuroda (Fujitsu) wrote:
> Dear hackers,
>
> Cluster.pm defines a function slot()which requires a slot_name as a key
> and returns attributes of the given slot, as a hash-ref. ISTM, the hash
> does not contain 'slot_name'.
>
> However, I found that some codes access it by using a key 'slot_name'. ISTM it always
> becomes 'undef' thus any tests are meaningless.
>
> It looks like that existing codes want to check the existing of given logical slots.
> So, it is enough to search with key 'plugin'. The valid value is set if exists, otherwise ''.
>
> How do you think?
I think you're right. The patch looks good to me.
-is($node_primary->slot('dropme_slot')->{'slot_name'},
- undef, 'logical slot was actually dropped on standby');
+is($node_primary->slot('dropme_slot')->{'plugin'},
+ '', 'logical slot was actually dropped on standby');
This seems like a separate issue from what your patch is addressing,
but since this test is meant to confirm that the slot was dropped
on the standby, shouldn't node_primary be node_replica instead?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
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: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, kuroda.hayato@fujitsu.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Some codes refer slot()->{'slot_name'} but it is not defined
In-Reply-To: <1fdfd020-a509-403c-bd8f-a04664aba148@oss.nttdata.com>
* 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