[Pgpool-general] How sqls in transaction handled with replicate_select disabled

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jan 20 01:22:15 UTC 2011


>  On 01/18/11 19:56, Tatsuo Ishii wrote:
>>> Sorry, now I understand fail over caused by the \d command problem is
>>> due to the replicate_select is set.  My question now is how to
>>> replicate a select function (with insert/update) when replicate_select
>>> is disabled.  It looks like that we can use 'black_function_list'
>>> mentioned in the manual.  However, is there an option to apply for all
>>> functions, instead of listing all of them under 'black_function_list',
>>> just in case there are too many to be listed ?  By the way, is there a
>>> limit for 'black_function_list' ?
>> You have two options:
>>
>> 1) Add all your functions to black_function_list you want to
>>     replicate. There's no limit for black_function_list.
>>
>> 2) Empty black_function_list and add a bogus function (for example
>>     "foo") to white_function_list. This will effectively replicate all
>>     function calls except "foo". Caution: this will cause an unwanted
>>     side effect: \d command will fail because replicated.
>>
>> BTW pgpool-II 3.1 will have an ability to use regular expression in
>> black_function_list and white_function_list(Thanks to Gilles Darold
>> and Guillaume Lela!). So if your project decide to name the functions
>> starting with "my_function_" for example, you could put something like
>> "^my_function_.*$" to indicate that all functions starting with
>> "my_function_" should be treated as they are writing.
>> --
> Tatsuo,
> 
> Thanks for the helpful information.  I have another question that I
> cannot figure out from the online manual.  How the following
> transaction sqls to be handled when the replicate_select is false and
> the replicate_mode is true.  Are they all replicated or handled
> differently ?
> 
> Case 1:
>     begin;
>     select sql;
>     insert sql;
>     commit;
> 
> Case 2:
>     begin;
>     insert sql;
>     select sql;
>     commit;
> 
> Thanks,
> Gary

You could always inspect which query is being sent to which node by
enabling:

log_per_node_statement = true
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-general mailing list