<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.FoxDiv20200427170544418401 { }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><div>Hi, Usama</div><div><br></div><div>Thanks for your comments. it’s helpfull.</div><div>I have removed dml_object_level_load_balance and made disable_load_balance_on_write to accept new value.</div><div>I have removed my changes in pgpool.conf.sample-stream.</div><div><br></div><div>Now i am writing a test script.</div><div>When i finish it, i will make a new patch.</div></div>
<div><br></div><div>Thanks<br>Best Regards</div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>sunbiao@highgo.com</div></div></span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em"><div>&nbsp;</div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b>&nbsp;<a href="mailto:m.usama@gmail.com">Muhammad Usama</a></div><div><b>Date:</b>&nbsp;2020-04-25&nbsp;00:55</div><div><b>To:</b>&nbsp;<a href="mailto:sunbiao@highgo.com">sunbiao@highgo.com</a></div><div><b>CC:</b>&nbsp;<a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers</a></div><div><b>Subject:</b>&nbsp;Re: [pgpool-hackers: 3592] add a feature: dml object level load balance</div></div></div><div><div class="FoxDiv20200427170544418401"><div dir="ltr">Hi Sunbiao,<br><br>Thanks for the patch and it looks line an interesting feature. I have just skimmed<br>through the patch and I have a few of small comments.<br><br>1 - Wouldn't it be better to add a new mode existing disable_load_balance_on_write parameter<br>instead of adding a new configuration parameter i.e dml_object_level_load_balance ?<br>You can make disable_load_balance_on_write to accept new value like<br>disable_load_balance_on_write = 'object' to enable this feature.<br><br>2- The patch contains some invalid changes in pgpool.conf.sample-stream file<br>i.e it changes the default values of black_function_list and disable_load_balance_on_write<br>configuration parameters which I am sure were not intended<br><br>3- The default value for new configuration parameter dml_object_level_load_balance_token_list<br>better be an empty<br><br>4- Instead of attaching a separate test script you could include a proper test case for the feature.<br><br>Thanks<br>Best Regards<br><br><div><font color="#666666">Muhammad Usama<br>Highgo Software (Canada/China/Pakistan) <br>URL : <a href="http://www.highgo.ca">http://www.highgo.ca</a> <br>ADDR: 10318 WHALLEY BLVD, Surrey, BC </font><div><br></div></div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 24, 2020 at 3:43 PM <a href="mailto:sunbiao@highgo.com">sunbiao@highgo.com</a> &lt;<a href="mailto:sunbiao@highgo.com">sunbiao@highgo.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div><span></span><div>Hi Hackers,</div><div>If sql like below:</div><div><br></div><div>begin ;</div><div>update tb_1 SET id = 1;</div><div>select * from tb_1 ;</div><div>select * from tb_2 ;</div><div>select * from tb_3 ;</div><div>select * from tb_4 ;</div><div>select * from tb_5 ;</div><div>commit ;</div><div><br></div><div>when set disable_load_balance_on_write = 'transaction'. write queries appear in an explicit transaction, subsequent read queries are not load balanced until the transaction ends. so all sql will be sent to primary node.</div><div><br></div><div>i think that “update tb_1 SET id = 1” and “select * from tb_1” should be sent to primary node.</div><div>actually, tb_2 tb_3 tb_4 tb_5 can be sent to standby node. if do this, will reduce primary load.</div><div><br></div><div>so i made a patch to implement my idea.</div><div>when transaction start, i will initialize a list to save table name of write queries.</div><div>read queries will check the list, if find the table name in list, read queries will be sent to primary.</div><div>when transaction end, i destroy the list.</div><div><br></div><div>i add two parameter:</div><div><br></div><div>dml_object_level_load_balance = on</div><div>dml_object_level_load_balance_token_list= 'tb_t1:tb_t2,insert_tb_f_func():tb_f,tb_v:tb_v_view'</div><div><br></div><div>use dml_object_level_load_balance_token_list to set relationships between objects, such as trigger, function, view.</div><div>If set dml_object_level_load_balance = on, disable_load_balance_on_write should be off.</div><div><br></div><div>Is it possible to add this feature?</div></div><hr style="width:210px;height:1px" color="#b5c4df" size="1" align="left">
<div><span><div style="margin:10px;font-family:verdana;font-size:10pt"><div><a href="mailto:sunbiao@highgo.com" target="_blank">sunbiao@highgo.com</a></div></div></span></div>
</div>_______________________________________________<br>
pgpool-hackers mailing list<br>
<a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
</blockquote></div>
</div></div></blockquote>
</body></html>