Re: [HACKERS] Interval for launching the table sync worker - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [HACKERS] Interval for launching the table sync worker
Date
Msg-id 020f7d54-1b7d-99a0-6bb5-ea932c1493a3@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] Interval for launching the table sync worker  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: [HACKERS] Interval for launching the table sync worker  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On 24/04/17 17:52, Masahiko Sawada wrote:
> On Mon, Apr 24, 2017 at 4:41 PM, Kyotaro HORIGUCHI
> <horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> + /*
> + * Remove entries no longer necessary. The flag signals nothing if
> + * subrel_local_state is not updated above. We can remove entries in
> + * frozen hash safely.
> + */
> + if (local_state_updated && !wstate->alive)
> + {
> + hash_search(subrel_local_state, &wstate->rs.relid,
> + HASH_REMOVE, NULL);
> + continue;
> + }
> 
> IIUC since the apply worker can change the status from
> SUBREL_STATE_SYNCWAIT to SUBREL_STATE_READY in a hash_seq_search loop
> the table sync worker which is changed to SUBREL_STATE_READY by the
> apply worker before updating the subrel_local_state could be remained
> in the hash table. I think that we should scan pg_subscription_rel by
> using only a condition "subid".
> 

I don't follow this.

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: [HACKERS] Remove dead interfaces added by mistake in 7c4f52409
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Interval for launching the table sync worker