Re: Some codes refer slot()->{'slot_name'} but it is not defined
От | Fujii Masao |
---|---|
Тема | Re: Some codes refer slot()->{'slot_name'} but it is not defined |
Дата | |
Msg-id | 1fdfd020-a509-403c-bd8f-a04664aba148@oss.nttdata.com обсуждение исходный текст |
Ответ на | Some codes refer slot()->{'slot_name'} but it is not defined ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>) |
Ответы |
RE: Some codes refer slot()->{'slot_name'} but it is not defined
|
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: