[pgpool-hackers: 4347] Re: Proposal: Add user_redirect_preference_list

Tatsuo Ishii ishii at sraoss.co.jp
Tue Jun 13 10:47:30 JST 2023


> Hi,
> 
> On Tue, 23 May 2023 19:23:25 +0900 (JST)
> Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
>> > Yes. I know the setting of app_name takes precedence if both of database and app_name are matched.
>> > 
>> > If we set:
>> > 
>> >   database_redirect_preference_list = 'test1:standby'
>> >   app_name_redirect_preference_list = 'app1:primary'
>> > 
>> > The following query will be sent to primary because the query matched both conditions
>> > and app_name takes precedence
>> > 
>> >     PGAPPNAME=app1 psql -d test1 -c "select 1"
>> > 
>> > However, users can configure the behavior of both database and app_name at the same time.
>> > 
>> > For example, the following query will be sent to standby,
>> > 
>> >     PGAPPNAME=app2 psql -d test1 -c "select 1"
>> > 
>> > and the following query will be sent to primary.
>> > 
>> >     PGAPPNAME=app1 psql -d test2 -c "select 1"
>> > 
>> > 
>> > I agree to unify the three settings of database, app_name and user,
>> > but we should mention that user can't set them at the same time.
>> 
>> I see your point. Maybe my idea (unifying *redirect_preference_list)
>> is not so good in terms of backward compatibility? If so, we should
>> give up the idea and just add
>> "user_name_redirect_preference_list". What do you think?
> 
> Because of the backward compatibility, I decided to just add a new parameter  "user_redirect_preference_list".
> 
> Patch is attached.

Thanks for the patch! Looks good to me.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list